Hullo,
I have tried searching with google and havent had much luck.
Autocad has the ability similar to Excel to have a custom data field (eg. modifying a date data field from 05/28/1988 to 28/05/88 just by changing variables.
I would like to be able to have a data field that automatically uses the file name as the drawing number - but with out the guff at the end of the file name (eg. 1900-SS-S-0001 Control Plan R01 becomes within the paper space drawing number field 1900-SS-S-0001 )
I would also like to add a Revision Field that looks at the end of the file name.
Any help even if it is - "It cant be done" is appreciated.
I am not the best user of the forums.
Thanks
John
What you are explaining in your request would have to be Text Fields. This type of text can connect to properties of Elements, Models or as you have requested the File. The following Wiki article should explain this reasonably ok.
http://communities.bentley.com/products/microstation/w/microstation__wiki/12506.text-fields-auto-updating-annotations
RegardsAndrew BellTechnical SupportBentley Systems
If it's always the first 14 characters of the FileName for the PlanName that's easy enough with Named Expressions. Start at position 0 and length=14 Expression: System.String.SubString(System.Path.GetFileName(ActiveFile.FileName),0,14) And the last 3 characters before the .dgn contain the Revision. for ......R01.dgn, should that Revision evaluate to R01, 01 or 1? Could a file named 1900-SS-S-0001 Control Plan.dgn exist? Or would the first version be named 1900-SS-S-0001 Control Plan R00.dgn or something else? What should ...R00.dgn evaluate to precisely?
If you want to go the VBA route, you'll first need to be very, very, clear on what you want that VBA to do to what elements and you'd probably be better of taking this to the MicroStation Programming forum.
If you want to use Named Expressions, you can avoid VBA. In the Titleblock you'd simply place something like "$Rev$" and Use Text substitutions in a Pen Table to replace "$Revs" at print with whatever the expression evaluates to (for your file "R01").
First 14 characters, and first 4 characters are easy with Named Expressions as well.
If e.g. the text "$StdFileName$" is always placed in your titleblock, and the Pen Table replaced that at Print with "1900-SS-S-001"
Scale of the "main attached xref" is going to be trickier to automate, unless this is equal to the Active Annotation Scale.
If not, you'll need a fixed way of identifying the "Main" Reference in all your files.
If you want Tags filled in on placement of the titleblock, you'll need to have a special command that does what you want it to do. This will be a near impossible task for a relatively novice user, unless you have a lot of time on your hands and are willing to learn MicroStation VBA. Automating these kind of tasks isn't really beginner level stuff.
In this file I made the Named Expressions, you could change the extension to dgnlib and add it to a location contained in the MS_DGNLIBLIST variable:
1900-SS-S-001 Control Plan R01.dgn
Pentable with just the Text substitutions:
MyPenTable.tbl
If you print a page containing the words $Job$, $Rev$ and/or $StdFileName$, with the pentable attached those words will be replaced with 1900, R01, 1900-SS-S-001 respectively.