How to generate multiple alignments from multiple polylines.

How to generate multiple alignments from multiple polylines.

Anonymous
Not applicable
9,491 Views
48 Replies
Message 1 of 49

How to generate multiple alignments from multiple polylines.

Anonymous
Not applicable

Hi All,

 

I have a question that is related to automation of a simple task. My background is hydraulic modelling of water networks. A water network for a city can be an elaborate system. Civil3d has well devised import mechanism to import model data in shapefile format.

 

For interference analysis, profile plotting and other allied tasks, the network pipes must have associated surface and alignments. Civil3d has multiple alignment generation options. However, it seems, all require significant man-hours (when it is a city scale branched network). I can dissolve the pipe network into polylines that can be used as objects for alignment generation. For each object, I left a unique integer ID in DF field (of the shapefile).Mapimport Shape with unique ID for each polylineMapimport Shape with unique ID for each polyline

Create alignment from objectsCreate alignment from objects

 

Alignment generation definition to be replicated for each polyline object.Alignment generation definition to be replicated for each polyline object.

My question is, is there any application or script that can take the polylines and generate alignment for each polyline without requiring any user intervention? Attaching a sample file that contains the polyline objects that need to be converted into alignments. For the seven polyline objects in the file, I want to generate seven corresponding alignments; preferably named 'Alignment - DF'. The process should be automated.

 

Much appreciate a quick response. Thanks in advance.

0 Likes
Accepted solutions (1)
9,492 Views
48 Replies
Replies (48)
Message 41 of 49

mayurmandloi04
Community Visitor
Community Visitor

how to use this codes ?

0 Likes
Message 42 of 49

beverly.carian
Explorer
Explorer

Hi Tim,

Thank you so much for writing this script — I was really excited to try it out!

I'm currently working on thousands of trackers for a large-scale utility PV solar plant, and manually creating alignments would take an enormous amount of time.

However, when I load the Lisp file, a window pops up with this:

„Object data table record ID was not provided.

Invalid record number.

 

Object data table record ID was not provided.

Invalid record number.”

 

I'm not sure how to proceed from there.

Could you please help me troubleshoot this? It would be a huge relief if your script could assist with automating this part of my work.

Thanks in advance for your support!

 

Beverly

 

 

0 Likes
Message 43 of 49

beverly.carian
Explorer
Explorer

Dear Mr Corey,

 

Thank you so much for writing this script — I was really excited to try it out!

I'm currently working on thousands of trackers for a large-scale utility PV solar plant, and manually creating alignments would take an enormous amount of time.

However, when I load the Lisp file, a window pops up (screenshot attached).


“Object data table record ID was not provided.

Invalid record number.

 

Object data table record ID was not provided.

Invalid record number.”

 

I'm not sure how to proceed from there.

Could you please help me troubleshoot this? It would be a huge relief if the script could assist with automating this part of my work.

Thanks in advance for your support!

 

Beverly

0 Likes
Message 44 of 49

neilyj666
Mentor
Mentor

Did you make the changes to styles and layers as discussed in Post 31?

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 45 of 49

beverly.carian
Explorer
Explorer

Dear Neilyj666,

 

I tried to modify the original script with the corrections on Post 31 but I'm still getting the error.

2025_09_10_13_10_46_Autodesk_Civil_3D_2024_Plot_O_Working_File.dwg_Master_File_.jpg

I attached as well the .lsp that I loaded. Please assist. 

 

Thank you!

0 Likes
Message 46 of 49

neilyj666
Mentor
Mentor

Can you share the drawing - I have just tried it with my version from 2022 and it works as expected in 2026

 

neilyj666_0-1757504388799.png

neilyj666_1-1757504412750.png

 

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
0 Likes
Message 47 of 49

beverly.carian
Explorer
Explorer

Hi Neilyj666,

 

Attach is the drawing.

Each point in the line represents the tracker piles.

Thank you in advance.

0 Likes
Message 48 of 49

neilyj666
Mentor
Mentor

I added the label sets, style and layer to your drawing that are shown in the lsp I sent in message 46—and all works as expected.

 

neilyj666_0-1757508211130.png

 

I then tried changing the sets, style and layer to ones already in your drawing but I got the same errors as you had...but I have no idea why this would be.

 

I have attached the drawing with new styles/labels/layer which works

 

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2026 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 49 of 49

beverly.carian
Explorer
Explorer

Hi Neilyj666,

 

Was busy delivering the work and it was so time consuming. I was hoping to use the "Create Offset Alignment" to expedite the work but it turned out,  I can't also use it because the trackers are not horizontally aligned.

 

Thank you for spending time to address my concern. I will study the attached file and see if it works from my side.

 

Beverly

0 Likes