Civil 3D Dynamo Functions

Hi there, new user here.

I’ve been looking up information about Dynamo looking to learn how to use as I see the potential. Right now I’m trying to create a script that allows me to create a defined number of Offset Alignments based on the centerline alignments I pick.

Is there a way to execute Civil 3D commands from within Dynamo? I browsed through the predefined nodes but I didn’t find what I was looking for, I saw that one can create custom nodes, however it would be better if I could know if its even possible to begin with.

Thanks!

Currently, there isn’t a node to create an offset alignment. Autodesk is working on developing more nodes, but I’m not sure if offset alignment is one of them. If you are familiar with Python, it should be possible to accomplish your goal using the .NET Alignment.CreateOffsetAlignment method in a Python node for Dynamo.

Is there any online help for achieving this? I’ve been looking for information but all I find is either for Revit or for writing C# nodes in Visual Studio.

There isn’t much out there that I’m aware of.

@jesusmaria890 here is an example in Python

OffsetAlignment.dyn (8.5 KB)

13 Likes

Thank you very much! I’ll try to figure out how to add something to the code to be able to also specify a list with the alignment names for each of the offsets.

This helps a lot!

1 Like

Can we use all the functionality listed in this method in api docs for start station, end station?
It appears this example only has one value passed (d) that appears to be associated with obsolete method?
http://docs.autodesk.com/CIV3D/2019/ENU/API_Reference_Guide/html/5fb37cb9-9811-3f98-343e-1d6098fc849a.htm
Just asking as want to experiment with this and sometimes the documentation is not obvious when
we need to convert to python.
To be clear can we use this from docs:

C#
public static ObjectId CreateOffsetAlignment(
	string alignmentName,
	ObjectId parentAlignmentId,
	double offset,
	ObjectId styleId,
	double startStation,
	double endStation
)

Any python example code always appreciated. I have noticed on using pycharm that contextual code tips dont always give correct example and it takes time abd guesswork to solve these issues.
cjm

1 Like

@cjm show me your example

Hi guys,

Can this Python be changed to accommodate for linked Offset Profiles as well ? With respect to the parent profile with slope parameter too?

Not sure if this is worthy of opening a new topic/issue in Githu though.

Thank you for you time.

1 Like