Importing Subassemblies from enu folder

Hi there,

I’m importing multiple subassemblies into C3D. For most of them it works just fine. There are only a few that don’t work which returns a null value. I don’t see what i’m doing wrong, anyone an idea? (@Paolo_Emilio_Serra1 )


Thanks!

I tested all subassemblies available. Some work and some not. Most not-working subassemblies consist of “more complex” subassemblies containing enumurations etc. This might be a problem? I can’t seem to open the dll files.

(@mzjensen are you familiar with openening .dll files within dynamo?)

Have you taken a look at the log file for the Civil 3D Toolkit yet? That might give a clue.

I get the following Exception:

I will look into this tomorrow with a clear head.

Edit: @mzjensen No idea what it means :rofl:

[7/26/2022 5:02:37 PM] EXCEPTION: Object reference not set to an instance of an object. at Autodesk.Civil.DatabaseServices.SubassemblyCollection.importParamToSubassembly(Subassembly SA, XmlNode nodeParam, Int32 displayOrder)
at Autodesk.Civil.DatabaseServices.SubassemblyCollection.importParamsToSubassembly(AeccDbSubassembly* pDbSubassembly, XmlNode nodeSA)
at Autodesk.Civil.DatabaseServices.SubassemblyCollection.ImportSubassembly(String subassemblyName, String atcFilePath, String itemId, Point3d location)
at Autodesk.Civil.DynamoNodes.CorridorExtensions.Subassembly.ImportSubassembly(String toolName, String name, Point location, String path) in D:_Civil3D\Civil3DToolkit\Civil3DToolkit\src\Autodesk.Civil3DToolkit\Civil3DToolkit\Civil3D\Assembly.cs:line 1155

No one with a similar problem? :smiley:

Sorry @sven.deleau, I don’t know :confused:

@sven.deleau what i discovered is that, your PKT file name and .Net Class name should be the same when you import subassembly in Dynamo (can you please check if thats the case.)

Please go though this if helps : Import custom subassembly - #18 by Paolo_Emilio_Serra1

1 Like

Hi,
Thanks for your reply!

They are the same, except for a dot replaced by an underscore (C3D did this automatically). This never seemed to be the problem since it worked for other files. Now it does work for half the files, and the others don’t work.

@Paolo_Emilio_Serra1
Are you familiar with this bug?

Thanks in advance

Still stuck…

I tried a python script from mzjensen to retrieve the .net class name and location.
This gave me back the exact import from the placed subassembly by hand. So i could use this information to directly enter it as input for a string for the Subassembly.ImportSubassemblyNode.
Same result however, some subassemblies just work others don’t…

@Paolo_Emilio_Serra1 We solved our issue

@geert.drijfhout Helpen me out on this,

The exception within the Civil3Dtoolkit is about a none value which is returned. (file log)
this seemed to be about empty parameters within the custom subassembly.

Filling in a “test” value solved it all :smiley:

2 Likes