Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro/script

8 REPLIES 8
Reply
Message 1 of 9
PeterLabs
580 Views, 8 Replies

Macro/script

Hello everyone,
I am trying to create a macro that let's me insert from a specific folder ( say k:\ico\civil\) so I can choose one of the dwg I want to insert in the drawing.
Can someone help me?

Regards Peter
Tags (1)
8 REPLIES 8
Message 2 of 9
Patchy
in reply to: PeterLabs

Go to OPTIONS, Files tab, click on Support File Search Path, go to the right and use Add, then browse to that folder.

Exit Autocad and restart.

Message 3 of 9
PeterLabs
in reply to: PeterLabs

Thanks but in this case that's not the problem. I want the script to popup/open the specific folder in AutoCAD so I can scroll in that folder to choose one of the drawings I want.
Message 4 of 9
PeterLabs
in reply to: PeterLabs

So what I mean is, I select the script/macro (I made a toolbar from it), a folderscreen pops up witch shows the path-location I defined, I scroll and search for the specific drawing I want at that moment, click on it and the drawing inserts.
Message 5 of 9
Patchy
in reply to: PeterLabs

It can be done with autolisp.

 

Make a Kinsert.lsp and add it to Startup Suite in APPLOAD

 

Code:

 

(defun c:Kinsert ( / )
(startapp "explorer" "k:\\ico\\civil")
)

 

and go to CUI, Toolbar,  make a button, in its macro put in:       Kinsert

 

After it popup, drag the drawing into your drawing area.

 

Message 6 of 9
PeterLabs
in reply to: PeterLabs

Thanks Patchy! I will gif it a try on Monday. I'll keep you posted!
Message 7 of 9
PeterLabs
in reply to: PeterLabs

Thanks a lot! It workt,...off course... 🙂 One thing. The Explorer does close by it's self like when you open a drawing in Autocad. Is this possible with some extra code? Regards, Peter p.s. I changed my mind. I want to use "open" instead of "insert".
Message 8 of 9
Patchy
in reply to: PeterLabs

You want to open a specific folder ?

Message 9 of 9
PeterLabs
in reply to: PeterLabs

Sorry! Very busy a couple of days.
Yes. So just like in AutoCAD. Open, select the drawing in that specific folder, drawing opens, explorer closes.
Thanks!

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

Post to forums  

Autodesk Design & Make Report

”Boost