Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

I need a LISP file that outputs the design speeds of an alignment

I need a LISP file that outputs the design speeds of an alignment

Shubz26
Enthusiast Enthusiast
1,085 Views
2 Replies
Message 1 of 3

I need a LISP file that outputs the design speeds of an alignment

Shubz26
Enthusiast
Enthusiast

I need a LISP file that outputs the design speeds of an alignment with start and end chainages. How can I do this? The LISP below takes me up to "Count=2", but no actual values.

 

(vl-load-com)

(setq e (car (entsel)))
(setq vlaobj (vlax-ename->vla-object e))
(setq CX1 (vlax-get-property vlaobj 'DesignSpeeds))
(vlax-dump-object CX1)

)

Civil 3D 2020
Intel Xeon CPU W3550 @ 3.07GHz
Nvidia Quadro 2000
25GB RAM
Windows 7 Enterprise 64 Bit
0 Likes
Accepted solutions (2)
1,086 Views
2 Replies
Replies (2)
Message 2 of 3

Jeff_M
Consultant
Consultant
Accepted solution

You are close to having what you need. Just loop through the DesignSpeeds:

(vlax-for ds cx1
  (princ (strcat "\nStation: " (rtos (vlax-get ds 'Station)) "  Speed: " (rtos (vlax-get ds 'value))))
  )

Note: If you add a t to the dump object function it will also list the methods available.

(vlax-dump-object CX1 t)

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3

Shubz26
Enthusiast
Enthusiast
Accepted solution

Thanks!

 

I eventually figured out that I needed to loop through the Items. I found a way to do it in another code I found online:

 

(vl-load-com)

(setq e (car (entsel)))
(setq vlaobj (vlax-ename->vla-object e))
(setq CX1 (vlax-get-property vlaobj 'DesignSpeeds))
(vlax-dump-object CX1)

(vlax-for for-item
(vlax-get vlaobj 'DesignSpeeds)
(vlax-dump-object for-item))

 

Civil 3D 2020
Intel Xeon CPU W3550 @ 3.07GHz
Nvidia Quadro 2000
25GB RAM
Windows 7 Enterprise 64 Bit
0 Likes