GettinBetter(work) Posted January 29, 2010 Posted January 29, 2010 With respect to ACADE2010 I have a custom titleblock with various attributes mapped for auto updating and it works fine. However prior to using 2010 Electrical, we used to manually suffix a revision code (two digits) to the filename, so that archived files can readily be recognised. Problem is, that ACADE puts the full filename (including the revision digits) into the filename attribute, and we already have a revision section elsewhere. Having the revion in the filename IS handy (nothing worse than having to open a file to see what revisio it is), so I was wondering if it is updated using a lisp file, and could it be modified to suppress the last 6 digits before assigning the value to the filename attribute? Any thoughts woud be appreciated. Quote
Lee Mac Posted January 29, 2010 Posted January 29, 2010 You can rename files in VL, using vl-file-rename if you like, or using the FileSystemObject (FSO) Quote
GettinBetter(work) Posted January 29, 2010 Author Posted January 29, 2010 I'd like to do it automatically, at the moment it already removed the .dwg from the filename, so it should be a case of removing a little more. I suppose it will also depend on whether its checking for text (".dwg") or a set number of chars? Quote
Lee Mac Posted January 29, 2010 Posted January 29, 2010 How many characters do you want removed and from which end? Or, is there a string to search for in the filename? Quote
GettinBetter(work) Posted February 1, 2010 Author Posted February 1, 2010 We normally use "-rev00" suffixed to filename, (e.g. 4532_JDHGFHJGF_-rev00) in order for published files to be instantly recognised without opening them, but when doing a global update this whole string is then placed into the filename attribute in the title block i.e. showing the revision part as well. Problem is that the titleblock already has a section for revision data. It seems autoCAD already removes the .dwg from the filename, so could it be modified to removed more? Quote
Lee Mac Posted February 1, 2010 Posted February 1, 2010 Ah, so you don't want to rename the files, just alter how AutoCAD updates your titleblock right? OK, You can get the filename in one of two ways (and maybe other ways) (getvar 'DWGNAME) (vla-get-name (vla-get-ActiveDocument (vlax-get-acad-object))) So you can now use substr to remove what you like (substr (setq Nme (getvar 'DWGNAME)) (- (strlen Nme) 4)) Quote
GettinBetter Posted February 1, 2010 Posted February 1, 2010 Do you think it would be possible to modify the existing code that removes the 'dwg? so that it removes more characters? Quote
GettinBetter Posted February 1, 2010 Posted February 1, 2010 Not yet, but I'll have a search for the DCL that produces the update window (if its getable) & see where it leads me, I thought somebody in the 'know' may just know the name of the file, or tell me it cant be done....I don't mind thaving a trawl...you never know what you might find I don't mind having a crack at the lisp, (although I'm a novice) nothing ventured nothing gained & if I can't find any usable files I'll attempt the code bit. It would have been nice to get it to work properly.......well as I want it that is. Regards LL 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.