Partial Data Fields

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

Parents
  • 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

    Regards
    Andrew Bell
    Technical Support
    Bentley Systems

  • The file name field is restricted, I believe - not allowing me to only use part of the file name eg : 1900-SS-S-0001 Control Plan R01 ---- using only 1900-SS-S-0001

    Can I modify what part of the file name I can use? first part last part etc.
  • I'm sorry if I'm not clear.
    All of our files have a standard file name at the start then a description following.

    eg.

    |-Std File Name-||-Gen Desc--||Revision|
    1900-SS-S-0001 Control Plan R01

    When I have tried to use the Field Editor it places everything including the General Description and Revision. All I'm after is the File Name at the Start - I would like to use the File name with a custom section that says only the first 14 digits to display.

    So that the file name appears as
    1900-SS-S-0001

    if it can be done in VBA could you point to a similar script that someone has created? I dont have the skills to write VBA as everything I have learnt in Microstation has been self taught. or Googled.

    Thanks for your reply.

    John
  • 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.

  • At the risk of really highlighting my lack of knowledge with microstation - how do I get that expression simply in to VBA? create a new file in the vba editor and just type that in? or would i need additional code to get the code associated with the field?

    but this is basically all I'm after.

    Yes the "R01" is the revision field I want to also create

    once I get/understand the file name one I believe it will give me enough info to create the same for

    -Revision
    -Scale of the main attached xref (to automatically fill in the scale info)
    - The Job number (first 4 digits of file name)

    Thanks for this.

    J
  • If the filename is always 14 characters, simple way is use Engineering Font and create a shape with fill to cover the rest of the texts, same method for the revision field
  • Another question is how site/configuration dependent are expressions. If were talking about populating "text" in a dgn is it static or dynamic? Using available fields might be a bit more stable.
Reply Children
No Data