Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum Environnement variable to get the file name or part of it
    • Sign In

    • State Verified Answer
    • Replies 4 replies
    • Subscribers 59 subscribers
    • Views 183 views
    • Users 0 members are here
    • file name
    • environnement
    • ProjectWise Administrator

    Environnement variable to get the file name or part of it

    JeremieDL
    Offline JeremieDL 3 months ago

    Hi, I'm trying to get the file file name and put them in a variable to display in the interface tab.  

    But my real goal is to get the begining part of the file name, 9 first characters to be exact.  Is this possible?

    Because in my project file name need to include the revision of the drawing but we need to remove this revision in the title bloc.

    So what I want is that my file name be like 45612-S01-RA.dgn but my titleblock display only the first 9 characters: 45612-S01

    So my thining was to get the file name and put it in a variable that only contain 9 caracters so that the rest would get discarded but I can't seem to find a way to have a variable that display the file name.

    Anybody can help here?

    • Sign in to reply
    • Cancel

    Top Replies

    • Sean Duphily
      Offline Sean Duphily Fri, Jun 9 2023 9:18 AM +1 verified
      Since you posted this in the ProjectWise forum, I'm assuming you are trying to set an Attribute to this value. If so, try: SELECT SUBSTRING(RIGHT('$DOCUMENT.FULLNAME$', CHARINDEX('\',REVERSE('$DOCUMENT…
    • JeremieDL
      Offline JeremieDL Fri, Jun 9 2023 9:20 AM in reply to Sean Duphily +1 verified
      Thanks I will try this right away! Where do you get the information on how to do this? I mean where did you find this?
    Parents
    • Sean Duphily
      +1 Offline Sean Duphily Fri, Jun 9 2023 9:18 AM

      Since you posted this in the ProjectWise forum, I'm assuming you are trying to set an Attribute to this value.  If so, try:

      SELECT SUBSTRING(RIGHT('$DOCUMENT.FULLNAME$', CHARINDEX('\',REVERSE('$DOCUMENT.FULLNAME$'))-1),1,9) AS ExtractString

      If this is something you are trying to do inside of MicroStation, there are better ways of doing this.

      Answer Verified By: JeremieDL 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    • JeremieDL
      +1 Offline JeremieDL Fri, Jun 9 2023 9:20 AM in reply to Sean Duphily

      Thanks I will try this right away!  Where do you get the information on how to do this?  I mean where did you find this?

      Answer Verified By: JeremieDL 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    • Sean Duphily
      0 Offline Sean Duphily Fri, Jun 9 2023 9:25 AM in reply to JeremieDL

      Understanding that PW is just a database, so any query against it can be completed with a standard SQL statement...so essentially Google is your friend as well as testing.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • JeremieDL
      0 Offline JeremieDL Fri, Jun 9 2023 10:01 AM in reply to Sean Duphily

      Thanks again for your time and for your answer, it works perfectly!

      Regards

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • JeremieDL
      0 Offline JeremieDL Fri, Jun 9 2023 10:01 AM in reply to Sean Duphily

      Thanks again for your time and for your answer, it works perfectly!

      Regards

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    No Data

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies