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
Unknown said: 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 really want is tags or attributed title block with tags ( similar in acad) and this then can be administered via vba to and from excel , and in excel you do all the naming, dates revs etc even extract the file name, model name etc..
There are 3rd party programs that pay for themselves very quickly in time saved both in trial and error trying to make your own vba and time saved QA doc control auto population of several drgs some can eve use DWG and DGN but thru microstation only.
Adam Lambert of Caddpro ( youtube his videos) and is very inexpensive as you can buy just the module you want or the whole suite.
Jon Summers LA Solutions has Flexitable with lots of possible uses.
There are others around but the two best I've come across I just listed....
Either will do what you want very easily and all through or with excel like tools...
Lorys
Started msnt work 1990 - Retired Nov 2022 ( oh boy am I old )
But was long time user V8iss10 (8.11.09.919) dabbler CE update 16 (10.16.00.80)
MicroStation user since 1990 Melbourne Australia.click link to PM me
If you prefer to sidestep VBA, you could make some NamedExpressions in a configured dgnlib and have those replaced at print with text substitutions.
In a configured dgnlib (like e.g. NamedExpressions.dgnlib) go to Utilities/Named Expressions
New Expression "PlanName", add the sybolsets ActiveFile, System.Path and System.String.
Expression: System.String.SubString(System.Path.GetFileNameWithoutExtension(ActiveFile.FileName),0,System.String.IndexOf(System.Path.GetFileNameWithoutExtension(ActiveFile.FileName)," "))
This is whatever part of the Filename comes before the first space, if that's a rule that's valid in your naming convention.
New Expression "Revision" with the same symbolsets as above.
Expression System.String.SubString(System.Path.GetFileNameWithoutExtension(ActiveFile.FileName),System.String.LastIndexOf(System.Path.GetFileNameWithoutExtension(ActiveFile.FileName),"_")+1,-1)
This should evaluate to whatever comes after the last underscore in the Filename but before the extension.
So for 1900-SS-S-001 Control Plan R01_A.dgn
PlanName should evaluate to 1900-SS-S-001.
Revision should evaluate to A.
File/Print
Resymbolization/New Pentable if you don't have one or edit an existing one.
With a pentable attached, Edit pentable.
Click Text Substitutions
Edit/Insert New
Actual: $PlanName$
Replacement: <expr?name=PlanName>
Actual: $Rev$
Replacement: <expr?name=Revision>
Close Text substitutions, Save the Pentable
Print a Sheet that contains the texts "$PlanName$" and "$Rev$" without quotes to a printer with this pentable attached and those texts should be replaced by 1900-SS-S-001 and A respectively, if you're printing from the File 1900-SS-S-001 Control Plan R01_A.dgn
Of course you won't see it appear on your sheet, it will just be replaced at print, but that might be preferable to running a VBA on every file.