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

Variable in Path to Block in Tool Palette?

3 REPLIES 3
Reply
Message 1 of 4
stevemayman
546 Views, 3 Replies

Variable in Path to Block in Tool Palette?

I would like to use a variable to set the path to our block library then append the sub-folders and block names to that when inserting block from a tool palette.  It seems like it should be possible since the path to some of ACAD's demo blocks reads: "%SampleFolderLang%\Dynamic Blocks\Annotation - Imperial.dwg"

 

Unfortunately when I try to edit a block's path through right-clicking a block in a tool palette and selecting "Properties..." I am forced into a dialog box and forced to navigate to a folder in addition to typing a path into the text box.  Whatever path exists is appended to the front of what is typed into the box.  I tried to navigate all the way to the root directory but I am given an "invalid" message when I try so select this as the source folder.

 

Is there any other way to edit a blocks path in a tool palette or to otherwise achieve this goal?

 

Thnaks!

3 REPLIES 3
Message 2 of 4
dmfrazier
in reply to: stevemayman

I think you would have to take a different approach to creating the tools in the Tool Palette.

 

Presumably you have used (or would like to use) the DesignCenter "Create Tool Palette of Blocks" from a folder method (or similar), which does a nice job of quickly creating a palette of block insertion tools.  As nice as this is, unfortunately it forces you into working a certain way.

 

If you want to have more control over the contents of the "macro" (so-to-speak), I think you would have to use something like CUI macros ("commands") or create a LISP routine that would accept a block name (with or without a partial or full path) as an argument.  Either of these could be run from a menu, or a toolbar, or could be adapted to a tool palette.

Message 3 of 4
stevemayman
in reply to: dmfrazier

Interesting...  Do you mean essentially building a toolbar button for each block we want to insert?  I actually did this for certain "intelligent" blocks like door numbers that auto-increase as the default, etc.  I suppose you could add that intelligence with this approach too.  I am not at work yet but the immediate hurdles I imagine are creation of the size-adjustable icons (unless they could somehow be harvested from the design-center created buttons and easy access to the insertion properties such as insertion, scale, etc.)

 

What would really be nice is a macro that could edit one of the existing block buttons to avoid those issues, unless it would be so easy that you could just create the button again if it needed adjusting.

 

I was thinking more along the lines of using a text editor on the file that the palette definitions are stored in and doing a search and replace on the path strings.  We are still sussing out the mysteries of the internal workings of the tool palettes so I thought I might find some helpful hints from those of you that had crossed that bridge before.  I have a vague recollection that you need an xml editor but it is not even clear to me which file I need to edit.

Message 4 of 4
stevemayman
in reply to: stevemayman

dmFraziers post got me thinking.  Even if I could get the variable name inserted in a path I would have to edit the path of every new block I (or any other user) created, setting up a maintenance nightmare.  So, rather than setting up a block path environment variable in AutoCAD I think I will just map the path to the network blocks as a drive on each workstation which will provide almost the same benefits (flexibility if you change the file structure, use multiple libraries, or have to resort to local libraries on a laptop.)  Not quite as elegant but a pretty solid workaround for the primary problem...

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

Post to forums  

Autodesk Design & Make Report

”Boost