Grigs Posted December 9, 2011 Posted December 9, 2011 I have a routine that calls a specific dimstyle. However, I am finding that I need to expand the lisp. The lisp sets a specific dimstyle based on either a linear dim or a leader. What I need to add is some error checking. Specifically, check to see if both styles are loaded in the drawing and if not, then load them. I don't know the lisp code needed to do this. Can someone help? Thanks. Quote
Lee Mac Posted December 9, 2011 Posted December 9, 2011 To check if a DimStyle is loaded: (tblsearch "DIMSTYLE" "YourDimStyle") Hence in an IF statement: (if (not (tblsearch "DIMSTYLE" "YourDimStyle")) .. Load it .. Quote
Grigs Posted December 9, 2011 Author Posted December 9, 2011 Thanks Lee. I see how to detect if a dimstyle is loaded. But what is the code to load it? Quote
Dadgad Posted December 10, 2011 Posted December 10, 2011 I have a routine that calls a specific dimstyle. However, I am finding that I need to expand the lisp. The lisp sets a specific dimstyle based on either a linear dim or a leader. What I need to add is some error checking. Specifically, check to see if both styles are loaded in the drawing and if not, then load them. I don't know the lisp code needed to do this. Can someone help? Thanks. Perhaps you should add both of them to your TOOLBOX so that they both autoload. Quote
Grigs Posted December 11, 2011 Author Posted December 11, 2011 They do autoload. The problem is when someone removes the dimstyle from a drawing. I would like the ability to detect if the dimstyles are indeed loaded, which I have, and if not then load them automatically. I'm just not sure the code involved to load it. If someone knows how, I would appreciate it. Quote
alanjt Posted December 12, 2011 Posted December 12, 2011 I keep all our dim/text/multileader styles in a dwg that I insert on startup for each drawing. That way, if the drawing is purged and a style is missing, you only have to reload the drawing to get all styles back. eg. (command "_.-insert" "BlockName=" nil) This will insert the block definition (all styles and layers within drawing) but cancel (the nil) before given the chance to insert an actual block reference. The "=" at the end of the block name will ensure to overwrite any existing definition - not necessary, but good practice and I like to cover all bases. I also immediately purge the block, but that isn't really necessary - also covering my bases. Quote
Dadgad Posted December 12, 2011 Posted December 12, 2011 I keep all our dim/text/multileader styles in a dwg that I insert on startup for each drawing. That way, if the drawing is purged and a style is missing, you only have to reload the drawing to get all styles back. eg. (command "_.-insert" "BlockName=" nil) This will insert the block definition (all styles and layers within drawing) but cancel (the nil) before given the chance to insert an actual block reference. The "=" at the end of the block name will ensure to overwrite any existing definition - not necessary, but good practice and I like to cover all bases. I also immediately purge the block, but that isn't really necessary - also covering my bases. I include all of that on my template, as well as my preferred Table styles, layers and their attributes too. Hit the ground running. Quote
alanjt Posted December 12, 2011 Posted December 12, 2011 I include all of that on my template, as well as my preferred Table styles, layers and their attributes too. Hit the ground running. As do I, but this protects my users from a situation where a style is purged or they open a drawing started by someone else. No matter what, each time they open a drawing, it will ALWAYS have all our company styles. Quote
Dadgad Posted December 12, 2011 Posted December 12, 2011 As do I, but this protects my users from a situation where a style is purged or they open a drawing started by someone else. No matter what, each time they open a drawing, it will ALWAYS have all our company styles. There's much to be said for consistency, and ALWAYS is pretty much as consistent as it gets. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.