Open Specific Drawing Location Custom Command in Tool Palette

Open Specific Drawing Location Custom Command in Tool Palette

daniel.escamillaBRIS
Contributor Contributor
1,426 Views
5 Replies
Message 1 of 6

Open Specific Drawing Location Custom Command in Tool Palette

daniel.escamillaBRIS
Contributor
Contributor

Hi everyone, I'm currently trying to create a command to open a specific drawing and have it sit in a tool palette for easy access.

 

For extra context, the drawing consists of extra piping ISO blocks, what I'm trying to do is assist the other designers/drafters to access the drawing quickly during an ISO scrub and not have it sit in their desktops, or go through a frenzy looking for it. 

 

So i have the command as ^C^C_open "S:\xxxx\Cadprogs\XXXXX-Iso\Miscpiping.dwg"; but all it does is open the file explorer. It doesn't even open the file location. I have also tried using the actual drive name not just (S:\), but no luck either.

 

Thanks y'all. 

0 Likes
Accepted solutions (2)
1,427 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

(defun C:OMPD () ; = Open Miscellaneous Piping Drawing
  (vla-activate
    (vla-open
      (vla-get-documents (vlax-get-acad-object))
      "X:/Your/File/Path/Miscpiping"
    )
  )
)

 

You can define a command like that, and have the command name in a Tool Palette button.  Or you can put it all in a button directly:

 

(vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) "X:/Your/File/Path/Miscpiping"))

Kent Cooper, AIA
Message 3 of 6

cadffm
Consultant
Consultant

for LT-Users: Use a script!

 

;----

open

"S:/123/456/myXYfile.dwg"

;----

 

and start the script from toolpalette

^C^C^C_.script;"d:/mycadstuff/toolpalettes/open_myXYfile.scr"

 

 

 

Sebastian

Message 4 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

@daniel.escamillaBRIS wrote:

.... the drawing consists of extra piping ISO blocks, what I'm trying to do is assist the other designers/drafters to access the drawing quickly .... 


If the idea is to pull Blocks from the drawing, you don't need to actually open it.  You can use the Design Center to get Blocks out of it.  Something like this in a Tool Palette button:

(command "adcenter" "adcnavigate" "X:/Your/File/Path/Miscpiping/Blocks")

will set the Design Center to be in that drawing and in the Blocks category, where you can see thumbnails of the Blocks, drag-and-drop them into the current drawing, or double-click on them to get more complete Insert options [scale, etc.].

Kent Cooper, AIA
Message 5 of 6

daniel.escamillaBRIS
Contributor
Contributor

Thanks Kent this helped!! I'll also try the DesignCenter route as well. 

 

The (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) "X:/Your/File/Path/Miscpiping"))  worked perfectly, but ill try the design center custom command once i convert half of the blocks in that drawing into actual blocks so it can pull them; its an old drawing the company provided me so some stuff is just normal items.

 

Thanks this is very helpful, and will speed up the ISO drawing scrubbing process!!!  

0 Likes
Message 6 of 6

daniel.escamillaBRIS
Contributor
Contributor

Ill keep this in mind for anyone using LT!!!

0 Likes