First, Thank you for all the assitance you have provided for all my other projects.. I visit your site OFTEN, and am more than mildly impressed with your work.
The hope of this, is to minimize us opening and closing of files when/if the dwg's name is changed by the engineer. I.E. Instead of opening 60 DWG's to perform the change, we just change the number in Windows Explorer. As well as for use in our template drawing, so this can be automated on newly created DWG's. This would be especially handy when copying drawings from older project to newer projects and renaiming. So, I would definitly prefere some form of Field Expression, and or DIESEL code. With the use of the LSP it will still require opening the drawing and performing a function, and the lisp would have to be installed on ever CAD technicians machine, both here and in KC. This could be problematic to coordinate/educate CAD technicians. The Field Expresson and Diesel code would be much cleaner operationally across the board. Although, from the results of my searching, seemingly much more difficult.
Do you think this is impossible with Field Expressions or DIESEL .. or even Rtext?
With the use of the LSP it will still require opening the drawing and performing a function
You could do a combination of field attributes with Lee's routine and set the field name under LispVariable. Either way the drawing needs to be opened to updated as mentioned above.
$(if,$(eq,-,$(substr,$(getvar,dwgname),2,1)),$(substr,$(getvar,dwgname),1,1),$(if,$(eq,-,$(substr,$(getvar,dwgname),3,1)),$(substr,$(getvar,dwgname),1,2),$(if,$(eq,-,$(substr,$(getvar,dwgname),4,1)),$(substr,$(getvar,dwgname),1,3))))
Well that worked! Now how do do the next one..
( forgive me I don't read code well... but I'm trying )
Lee,Maybe talk to the person that can give you rights. I agree that lisp is the best way to approach this, and Lee's already given you the solution. Beating dead horses has never been fun. :P
I like the Lisp, but I can not adjust the acaddoc.lsp. I do not have rights. I can use it on my machine. But again, what we're .....
If I can cover 95% of the possibilities.. than I still have something worth while.
unit .. up to 3 char
disc 1 char
type 2 char
syst 3 char
Number 5-7 char (I know this one's going to be a *****)
sheet 1-4 char
I don't know what the max lenth of DIESEL code is but I'm pretty sure it's pretty long.. I think beyond 255 char.
$(if,$(eq,-,$(substr,$(getvar,dwgname),2,1)),$(substr,$(getvar,dwgname),1,1),$(if,$(eq,-,$(substr,$(getvar,dwgname),3,1)),$(substr,$(getvar,dwgname),1,2),$(if,$(eq,-,$(substr,$(getvar,dwgname),4,1)),$(substr,$(getvar,dwgname),1,3))))
$(if,$(eq,-,$(substr,$(getvar,dwgname),2,1)),$(substr,$(getvar,dwgname),3,1),$(if,$(eq,-,$(substr,$(getvar,dwgname),3,1)),$(substr,$(getvar,dwgname),4,1),$(if,$(eq,-,$(substr,$(getvar,dwgname),4,1)),$(substr,$(getvar,dwgname),5,1))))
$(if,$(eq,-,$(substr,$(getvar,dwgname),2,1)),$(substr,$(getvar,dwgname),5,2),$(if,$(eq,-,$(substr,$(getvar,dwgname),3,1)),$(substr,$(getvar,dwgname),6,2),$(if,$(eq,-,$(substr,$(getvar,dwgname),4,1)),$(substr,$(getvar,dwgname),7,2))))
$(if,$(eq,-,$(substr,$(getvar,dwgname),2,1)),$(substr,$(getvar,dwgname),8,3),$(if,$(eq,-,$(substr,$(getvar,dwgname),3,1)),$(substr,$(getvar,dwgname),9,3),$(if,$(eq,-,$(substr,$(getvar,dwgname),4,1)),$(substr,$(getvar,dwgname),10,3))))
$(if,$(eq,-,$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),5),1)),$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),4),1),$(if,$(eq,-,$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),6),1)),$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),5),2),$(if,$(eq,-,$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),7),1)),$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),6),3),$(if,$(eq,-,$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),8),1)),$(substr,$(getvar,dwgname),$(-,$(strlen,$(getvar,dwgname)),7),4)))))
I would like to know if the LISP Mr. Lee Mac supplied could be modified to run by command instead of automating it thru the acaddoc.lsp.
I've attached a DWG and my edited verson of Mr. Lee's Code.
Sorry, but what do you mean by 'run by command'?
QuoteSorry, but what do you mean by 'run by command'?
I had assumed this was the type of lisp that would auto run upon opening the dwg. In the code I saw "(defun c:test"
I after loading I tried to run the LSP by typing in c:test.. and I got "Unknown command"
Also, I assumed that I needed to keep the " " around the tag names and block name in the LSP code. I hope that is correct.
I'm trying hard to learn here, it's a bit of trial by fire... I managed to figure my way through the DIESEL text, the more Lisp routines I work with the more I learn.. some of it is way over my head.. and sometimes I have those eureaka moments. I hope you can appreciate my effort.
This is not a primary function of mine at work.