PDA

View Full Version : Spline Question



pdstro
2019-12-27, 03:36 AM
Hello. Here's a spline question that is puzzling me. Using the spline command, when finished, hit enter and the command is over. When I tried using it in a lisp I have to hit enter 3 times...once to end creating the spline and once on each end of the spline.

Back story is a coworker likes to use the spline command for when we draw cables to get his layout. He then uses splinedit, then pedit so he can give it a thickness. So I made an attempt to create this for him to save him some steps. This works, but like I mentioned in the beginning, I'm asked to hit enter on each side of the spline. This happens to me even if my lisp only consisted of (command "spline").



(setq SC (getvar "DIMSCALE"))
(setq CABTHK (/ 0.05 (/ 1 SC)))
(command ".-LAYER" "m" "CABLES" "c" "82" "CABLES" "lt" "continuous" "CABLES" "")
(command ".spline")
(while (> (getvar 'cmdactive) 0) (command pause))
(command ".splinedit" "L" "P" "")
(command ".pedit" "L" "W" CABTHK "")
(princ)
)


Any thoughts? Thanks,
Paul

BIG-AL
2019-12-28, 07:12 AM
Try this



(command ".spline")
(while (= (getvar 'cmdactive) 1) (command "pause"))
(command "" "")

pdstro
2019-12-28, 11:30 AM
Try this



(command ".spline")
(while (= (getvar 'cmdactive) 1) (command "pause"))
(command "" "")


Thanks Big-Al,

I tried that and I'm still being asked to "specify start tangent:" and "specify end tangent:".

Paul

Tom Beauford
2019-12-29, 07:25 PM
Old link, but still relevant
Command Versioning in AutoCAD: https://withoutanet.typepad.com/without_a_net/2009/12/command-versioning-in-autocad.html
or from AutoCAD Lisp Help: initcommandversion (AutoLISP) http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-6176FC98-DC5D-433E-8D76-F481BE68D46A

pdstro
2019-12-29, 09:12 PM
Old link, but still relevant
Command Versioning in AutoCAD: https://withoutanet.typepad.com/without_a_net/2009/12/command-versioning-in-autocad.html
or from AutoCAD Lisp Help: initcommandversion (AutoLISP) http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-6176FC98-DC5D-433E-8D76-F481BE68D46A

Thanks Tom for the links. Wow...that explains why my fillet lisp routine always asked me for the "U" to do the multiple selections, but "M" for the command line version. That was a question that I always wanted to ask before, but didn't. Lol.

I will update my lisp when I get back to work on Thursday. Even if that doesn't solve the spline issue it fixed my other one. Lol.

Thanks for the info. I will keep you posted.

Paul

pdstro
2020-01-02, 06:57 PM
Old link, but still relevant
Command Versioning in AutoCAD: https://withoutanet.typepad.com/without_a_net/2009/12/command-versioning-in-autocad.html
or from AutoCAD Lisp Help: initcommandversion (AutoLISP) http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-6176FC98-DC5D-433E-8D76-F481BE68D46A

Thanks Tom. The "initcommandversion" did the trick. I was able to correct my fillet lisps I had also.

Thanks for the info.

Paul

Tom Beauford
2020-01-02, 07:04 PM
Thanks Tom. The "initcommandversion" did the trick. I was able to correct my fillet lisps I had also.
Thanks for the info.
Paul

Glad you worked it out. Now that you're hooked we hope you enjoy lisping as much as we do!

pdstro
2020-01-02, 07:34 PM
Glad you worked it out. Now that you're hooked we hope you enjoy lisping as much as we do!

I do enjoy it. My only thing is that I was never really able to get all in. I can tweak what has been written a little or do new lisp that's very basic, but that's to the extent of my knowledge. This past year is when I decided to start updating our blocks and standards and try to improve our process which allowed me to do more coding. Wish I did this many years ago. I was only ever able to do a little here or there because I was swamped. If I really knew what I was doing, I would've rewritten some other code to redo what was originally done back in the 90's.

Thanks again for the help.