Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcadE Commands called without loading dialog box?

5 REPLIES 5
Reply
Message 1 of 6
cbenner
391 Views, 5 Replies

AcadE Commands called without loading dialog box?

I'm sure this has been asked before, but I can't find a good answer so....

 

Is there any way to call an Autocad Electrical command in Lisp, without it opening the command dialog box?  Specifically, I would like to call AECOMPONENT, and just name the component, not have to open the icon menu and search for it.  Based on other advice I got (c:aecomponent) does not work, still pulls the icon menu up.

 

Any thoughts?  Are there switches I can use to force this?

5 REPLIES 5
Message 2 of 6
bhull1985
in reply to: cbenner

Yeah.. try (command "-aecomponent")

if that doesn't work you can try

 

(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object))(strcat "-aecomponent"))

 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 3 of 6
cbenner
in reply to: bhull1985


@bhull1985 wrote:

Yeah.. try (command "-aecomponent")

if that doesn't work you can try

 

(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object))(strcat "-aecomponent"))

 


Tried both.  No go.  -aecomponent is unrecognized by AcadE.  Take the "-" off, and I'm right back where I started.  Must be this can't be done without more serious programming power than I have.

Message 4 of 6
bhull1985
in reply to: cbenner

Hmm.

Have you considered "loading" the menus via (command "menuload" "electrical.cuixname") and then trying your functions?

Usually you have to (command "menuload" "...") along with a (menucmd "...") in order to get something to appear on the menu bar so perhaps if you just load it into memory you can have access to the functions.

Otherwise go steal the appropriate lisp defuns from the electrical package and add into your own acaddoc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 5 of 6
cbenner
in reply to: bhull1985

I think I'm just hosed.  These are compiled commands.  Probably no way of opening them up to see how they tick.

 

Well, this sets me back a long way in doing what I wanted to do.  Thanks for trying to help though.

Message 6 of 6
TomTom111
in reply to: cbenner

What I have done in the past is just use the command ("-insert" ... ) and provide the DWG name.

As long as the DWG is in the library and icon menu path, and/or the support file search path, it should work.

Hope this helps.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost