I am attempting to populate point description with station/offset from an alignment.
Alignments have a method called StationOffset(4), where you give it X, Y and it returns Station and Offset. Given alignment variable called algn, the following shoud work, no?
(vlax-invoke-method algn 'StationOffset ptx pty sta off)
ptx and pty are real numbers. Sta and off are the variables into which I want to place station and offset. If I don't create those variables ahead of time, I get:
; error: ActiveX Server returned an error: Parameter not optional
If I do create the sta and off variable ahead of time, I don't get the error, but the variables are not re-populated.
Any ideas?
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
@tcorey wrote:
Any ideas?
Yes, use the Sincpac-C3D tools for this, it's much simpler and you can link the points to an alignment so they will update as needed.
However, to answer your question, when you pass a variable to a method which will fill said variable, precede it with a quote:
(vlax-invoke-method algn 'StationOffset ptx pty 'sta 'off)
That's the first thing I told him, that SincPac can do this, but his firm is under the thumb of a large international firm and they won't allow purchase of third party software, even if paying for a custom solution costs more. It's messed up, but that's the corporate world for you.
Thanks for helpng, Jeff.