vl-cmdf

vl-cmdf

scott_bolton
Advocate Advocate
782 Views
16 Replies
Message 1 of 17

vl-cmdf

scott_bolton
Advocate
Advocate

When I load a (vl-cmdf...) line of code from the VLIDE the command works OK but AutoCAD is left hanging. No amount of [ESC]'ing brings it back. If I run the entire routine from the VLIDE or AutoCAD all is fine, it's just if I "Load selection". Any idea why?

 

Example: (vl-cmdf "_extrude" SMK_temp_ent "" SMK_height)

scottbolton_0-1699179849189.png

 

0 Likes
783 Views
16 Replies
Replies (16)
Message 2 of 17

paullimapa
Mentor
Mentor

Any difference if you use command or command-s 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 17

scott_bolton
Advocate
Advocate

Nope.

0 Likes
Message 4 of 17

paullimapa
Mentor
Mentor

how about using this code:

(vla-Sendcommand(vla-Get-ActiveDocument(vlax-Get-Acad-Object)) "_extrude\n!SMK_temp_ent\n\n!SMK_height\r"))

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 17

Sea-Haven
Mentor
Mentor

Works for me I used copy and paste the 1 line to command line, note I did set the values 1st. That could be your problem trying to run from vlide.

 

: circle Select center of circle rad etc

(setq smk_height 100)
100
(setq smk_temp_ent (car (entsel))) ; pick circle
Select entity: <Entity name: 6343fcd0>

(vl-cmdf "_extrude" SMK_temp_ent "" SMK_height)
T

 

 

0 Likes
Message 6 of 17

paullimapa
Mentor
Mentor

If you’re running AutoCAD 2022 and above, you should consider switching from using vlide to VB Code which is what Autodesk now recommends 

https://help.autodesk.com/view/ACD/2022/ENU/index.html?guid=GUID-7BE00235-5D40-4789-9E34-D57685E8387...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 7 of 17

scott_bolton
Advocate
Advocate

The command runs correctly, it's just the behaviour of AutoCAD afterwards - it hangs.

0 Likes
Message 8 of 17

scott_bolton
Advocate
Advocate

They've been suggesting this for years, but given they've just introduced lisp for 2024 LT I'm not worried.

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/whats-your-thoughts-on-autolisp-in-a...

0 Likes
Message 9 of 17

ВeekeeCZ
Consultant
Consultant

Would you post the actual code? And possibly sample file.

0 Likes
Message 10 of 17

scott_bolton
Advocate
Advocate

(setq SMK_ent (car (entsel)))

(setq SMK_height 0.050)

(vl-cmdf "_extrude" SMK_ent "" SMK_height)

 

No file necessary - you just need a small rectangle. Just paste the code into the Visual LISP Console. The hanging behaviour is exhibited in all files when you switch back to AutoCAD.

0 Likes
Message 11 of 17

ВeekeeCZ
Consultant
Consultant

Well, I can see that. If I replace vl-cmdf with command, it seems ok. I can only guess why is that.

 

But... why is that the issue? If it works fine from VLIDE, also fine if running from ACAD command-line... it never occurs to me to try it from the console. But I just never use the console for acad commands.

0 Likes
Message 12 of 17

scott_bolton
Advocate
Advocate

Good! I'm glad it's not just me.

The reason why it's a problem is that I load the particular code that I'm working on in a lsp file to check it.

scottbolton_1-1699263857804.png

 

 

0 Likes
Message 13 of 17

ВeekeeCZ
Consultant
Consultant

Just a question, why do you prefer vl-cmdf over command.

0 Likes
Message 14 of 17

scott_bolton
Advocate
Advocate

For the reason it was introduced:

scottbolton_0-1699264381155.png

 

0 Likes
Message 15 of 17

ВeekeeCZ
Consultant
Consultant

Ok, so you know how it works.

Sorry, I can't figure out any logical reason why it should be a problem for vl-cmdf, unlike command (at least in my case).

 

0 Likes
Message 16 of 17

paullimapa
Mentor
Mentor

what does this have to do with LT since VLIDE only works in AutoCAD


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 17 of 17

komondormrex
Mentor
Mentor

it is not a problem with vl-cmdf at all. it is problem with VLIDE software and since i've experienced similar situation more than once with different lisp statement or lisp statements in various scenarios i would recommend  do not make such experiments with VLIDE while you are on something important to not loosing it.