Hi!
I am trying to write a dynamo graph to generate custom PVI report. While doing so, I am using Civil3DToolkit to select the profile and alignment. The Object type that I am getting is Autodesk.Civil.DynamoNodes.Profile and Autodesk.Civil.DynamoNodes.Alignment.
While using the Civil3D API members / properties along with Autodesk.Civil.DynamoNodes in Python node, error is thrown.
How should I convert these to Autodesk.Civil.DatabaseServices.Profile and Autodesk.Civil.DatabaseServices.Alignment (and vice versa) to use them within Python scripts.
Also, is there a way to convert Autodesk.Civil.DynamoNodes.PVI to Autodesk.Civil.DatabaseServices.ProfilePVI and Autodesk.Civil.DynamoNodes.AlignmentSubEntitiesExtensions.AlignmentSubEntity to Autodesk.Civil.DatabaseServices.AlignmentSubEntity (and also vice versa)
Since those both inherit from the CivilObject class, you should be able to get the DatabaseServices objects with the InternalDBObject property. Or you can get the object ID with the InternalObjectId property and then return the object via transaction.
For the PVI and SubEntity question, it depends on how Paolo set up those classes. If they inherit from the CivilObject class, then the above approach should work. You could check by trying to use one of the CivilObject nodes on them (like CivilObject.Name) and see if it works. Or you could browse the .dll in Visual Studio and see how the class library is setup.
1 Like
Thanks for your response!
I could retrieve the Alignment and Profile as Autodesk.Civil.DatabaseServices, using InternalObjectId and then using the transaction manager to retrieve it.
Not sure how to use InternalDBObject property.
However, the InternalObjectId method did not work for PVI and alignment SubEntity.
On using CivilObject.Name node, I got a warning saying it expects Autodesk.Civil.DyanmoNodes.CivilObject but was called with Autodesk.Civil.DynamoNodes.PVI.
I looked into the dll through Visual Studio but, could not figure out how to use the information.