Dynamo Creating Alignment output?!

Please, anyone could help to return the created object “Alignment”?

image

Change your methods return type from void to ObjectId then return the civilAlignment.

yeah, i have tried this and it’s give me some number “45353” like id … i need the real object the alignment.

Technically speaking ObjectId is the ‘real object’ as an ObjectId is an object from an OOP standpoint, but I’m guessing what you mean is you want the Alignment entity which the ObjectId refers to? If that is the case then the Civil3d API should have a method to obtain the element from the ObjectId; I’m not familiar with Civil3D nor its API however but if its similar to the RevitAPI then it will be something similar to this var alignmentElement = doc.GetElement(alignmentObjectId);.

Civil 3D and Revit APIs are very different, please stop confusing people.
The issue is to return not the Civil 3D Alignment but rather the Dynamo wrapper of a Civil 3D Alignment.

You have many options:
Selection.AlignmentByName(name, document);
or
SelectionByQuery.GetObjectByObjectHandle(alignmentObjectId.Handle.ToString());

Last, you need to use the return keyword in the definition of the node.

Thank you Paolo :+1: … it’s work now :slight_smile:

1 Like

Thank you Thomas for your help :slight_smile: appreciate it .

1 Like