LIST command addition

LIST command addition

barry2104
Collaborator Collaborator
2,624 Views
23 Replies
Message 1 of 24

LIST command addition

barry2104
Collaborator
Collaborator

I have a polyline with say 100 nodes along the way, running in the direction it wants to. I want to spit out a coordinates list for each node (which is what the command LIST is good for), but on top of this, I want an extra column/Output at each node for the chainage along the way. So say for example each node is 3 metres after the previous node, the first Outputs would read:

            At Point X=(x-coordinate)   Y=(y-coordinate)   C=0.000

            At Point X=(x-coordinate)   Y=(y-coordinate)   C=3.000

            At Point X=(x-coordinate)   Y=(y-coordinate)   C=6.000

            At Point X=(x-coordinate)   Y=(y-coordinate)   C=9.000

...and so on

I don't care what the chainage is called (in the example above I called it "C"), nor whether this is before or after the X/Y coordinates.

Does anyone know how this can be done?

If via Lisp, then perhaps the output can be even more simplified to save cleaning up in Excel (removing the "At Point X=" etc from the cells) after reading out:

            (x-coordinate), (y-coordinate), (Chainage) 

Running AutoCAD Architecture 2020, in German
0 Likes
Accepted solutions (2)
2,625 Views
23 Replies
Replies (23)
Message 21 of 24

barry2104
Collaborator
Collaborator
Just copying it to the clipboard is enough, as sometimes it's to paste into a txt file, sometimes into xls, sometimes even into an email!
Running AutoCAD Architecture 2020, in German
0 Likes
Message 22 of 24

barry2104
Collaborator
Collaborator

Oh and i guess since there are effectively 3 different lisps needed here, they obviously need to have different names/commands.

XYKM was the original one for the chainage, that can stay

XYZ and XY would suffice for the other two lisps respectively

Running AutoCAD Architecture 2020, in German
0 Likes
Message 23 of 24

Sea-Haven
Mentor
Mentor

Something like this lets get correct answer before doing code like 3 times.

 

screenshot304.png

 

(if (not AH:Toggs)(load "Multiple toggles.lsp"))
(setq ans (reverse (ah:toggs '("Choose options " "XY" "Z" "Chainage" "Csv"))))

0 Likes
Message 24 of 24

barry2104
Collaborator
Collaborator

not sure if it's just too early in the morning for me, but that lisp you attach loads okay, but nothing I enter in the command bar gets recognised... What's the command? mkv_lst by the looks of it (directly after "defun") but that seems odd, and doesn't get a reaction from AutoCAD 2021 either

Running AutoCAD Architecture 2020, in German
0 Likes