draworder lisp into vba

draworder lisp into vba

Anonymous
Not applicable
738 Views
5 Replies
Message 1 of 6

draworder lisp into vba

Anonymous
Not applicable

Hi,

I made a very simple lisp routine in LISP.

Now I want to have it in VBA.

Can someone help me. I'm not so good with VBA jet.

gr. Laszlo

(defun C:draworderbrt ()
(command "_.draworder" (ssget "x" '((8 .
"A-BA1300__VloerenOpGrondslag,X-BL$12A__GebiedenenOpp,A-BA2100__Buitenwanden"))) "" "_back")
(command "_.draworder" (ssget "x" '((8 . "A-BV2300__Vloeren"))) "" "_front")

(princ)
)

 

 

0 Likes
739 Views
5 Replies
Replies (5)
Message 2 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

you can use your LISP-statements 1:1 by using SendCommand .. that's the easiest version.

You can go up to modify the internal tables for DrawOrder ... that's the maximum power/maximum effort version (look >>>here<<<)

 

And just to make sure (as I referenced to a sample for dotNET) ... don't start now with porting to VBA (for AutoCAD), it's not the safest bank for the future and, if you change to 64bit it get's extremely slow (and the work extrem has to be raised 😉 )

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 6

Anonymous
Not applicable

Yes, I knew it's possible with sendcommand, but I'm interesting what's te code look like when it is programming with vba.

Can you help me?

 

gr. LaszloSmiley Indifferent

0 Likes
Message 4 of 6

arcticad
Advisor
Advisor

afaik: There isn't a way to do it just VBA you will have to use lisp or .net.

---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 5 of 6

Anonymous
Not applicable

Oke thanks.

Is there a way to select the named layers in a drawing:

A-BA1300__VloerenOpGrondslag

X-BL$12A__GebiedenenOpp and

A-BA2100__Buitenwanden

using vba with selectionset add layers or something  and than using ThisDrawing.SendCommand "draworder" ?

 

gr Laszlo

0 Likes
Message 6 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

imho no, there is no direct way to get a VBA-selection to LISP, I always used the VL.Application for that type of progress when I wrote a VB/VBA-App and had to use some LISP-statements.

Search-statement if that helps: >>>VL.Application.17<<<

 

The only way (more workaround) I found to come to anything similar to that is to use the PICKFIRSTSELECTIONSET that can be accessed from both sides of development.

 

Sorry, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes