Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum [CONNECT] Harvest Active PW Path
    • Sign In

    • State Suggested Answer
    • +1 person also asked this people also asked this
    • Replies 9 replies
    • Answers 1 answer
    • Subscribers 63 subscribers
    • Views 1389 views
    • Users 0 members are here
    • connect
    • File
    • logical path
    • path
    • Configuration Variables

    [CONNECT] Harvest Active PW Path

    Jon Summers
    Offline Jon Summers over 2 years ago

    MicroStation has many configuration variables that an Admin uses to define the operating parameters of a CAD session.  Some variables are defined in configuration files, some variables are dynamic and change during a MicroStation session as a user opens and closes DGN files.

    An example of a MicroStation dynamic variable is _dgnfile, which contains the file path of the active DGN file. You can see its value in MicroStation using key-in EXPAND ECHO $(_dgnfile).  The path is displayed in MicroStation's Message Center.

    Consider this question from the MicroStation Forum by mwlong: We need the PW path. If a subconsultant looks at a pdf file and would like to reference that file to one of their files they will have issues locating the file on PW. I've run into this many times. Even looking at our own files. If we have the PW path displayed it aids others in locating the files so you don't need to track down the person who knows where the files are located.

    Is there an analogous PW configuration variable that contains the PW logical path to the active document? 

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Oct 7 2021 10:54 AM +1
      The original question was for putting the path on a PDF. I know of 2 ways to accomplish this. The question here is how to get the path inside of MicroStation itself, I know of zero ways to accomplish this…
    Parents
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Oct 7 2021 10:54 AM

      The original question was for putting the path on a PDF. I know of 2 ways to accomplish this. The question here is how to get the path inside of MicroStation itself, I know of zero ways to accomplish this.

      For text substitution you have to use a design script to do it. You can stack a design script alongside your normal MicroStation pen table and both will apply.

      Method 1 only works when you use Renditions inside of ProjectWise. Renditions defines a whole bunch of environment variables that can be used in design scripts (and only design scripts, these are not MicroStation variables or OS environment variables).

      if (type eq text) then
      	if (characters eq '*$method1$*') then
      		; This works for renditions only, uses environment variables set by ICS server
      		; RENDSVC_DATASOURCE       => integrationserver:datasrouce
      		; RENDSVC_FULLFILEPATHNAME => Everything after the \Documents\ part of the URL
      		envr_variable = "RENDSVC_DATASOURCE"
      		characters = "pw:\\" + envr_value + "\Documents\"
      		envr_variable = "RENDSVC_FULLFILEPATHNAME"
      		characters = characters + envr_value
      	endif
      endif
      

      Method 2 works in MicroStation (v8i and connect) Print (presumably Print Organizer, but I did not test) and Renditions.

      if (type eq text) then
      	if (characters eq '*$method2$*') then
      		; This works for MicroStation print, print organizer and renditions
      		; pw_file_url_type sets how the URL is formatted.
      		pw_file_url_type = pw_location_visual
      		characters = PW_MASTER_FILE_URL
      	endif
      endif
      

      If Method 2 works in regular print AND renditions why did I mention Method 1?

      • Renditions sets a whole bunch of environment variables that can be used. Every projectwise project property, document attribute and other metadata is available.
        • See: Environment variables set by rendition service for character substitution - Content Publishing Wiki - Content Publishing - Bentley Communities
      • The Connect documentation of design scripts specifically says PW_MASTER_FILE_URL is not implemented, so it shouldn't work. No idea if this means it'll be pulled in the future or maybe i just haven't seen the scenario where it doesn't work or maybe the documentation is just wrong.
        • See: Keywords Not Implemented (bentley.com)

      This is what the 2 methods produce for me in my test:

       

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Oct 7 2021 10:54 AM

      The original question was for putting the path on a PDF. I know of 2 ways to accomplish this. The question here is how to get the path inside of MicroStation itself, I know of zero ways to accomplish this.

      For text substitution you have to use a design script to do it. You can stack a design script alongside your normal MicroStation pen table and both will apply.

      Method 1 only works when you use Renditions inside of ProjectWise. Renditions defines a whole bunch of environment variables that can be used in design scripts (and only design scripts, these are not MicroStation variables or OS environment variables).

      if (type eq text) then
      	if (characters eq '*$method1$*') then
      		; This works for renditions only, uses environment variables set by ICS server
      		; RENDSVC_DATASOURCE       => integrationserver:datasrouce
      		; RENDSVC_FULLFILEPATHNAME => Everything after the \Documents\ part of the URL
      		envr_variable = "RENDSVC_DATASOURCE"
      		characters = "pw:\\" + envr_value + "\Documents\"
      		envr_variable = "RENDSVC_FULLFILEPATHNAME"
      		characters = characters + envr_value
      	endif
      endif
      

      Method 2 works in MicroStation (v8i and connect) Print (presumably Print Organizer, but I did not test) and Renditions.

      if (type eq text) then
      	if (characters eq '*$method2$*') then
      		; This works for MicroStation print, print organizer and renditions
      		; pw_file_url_type sets how the URL is formatted.
      		pw_file_url_type = pw_location_visual
      		characters = PW_MASTER_FILE_URL
      	endif
      endif
      

      If Method 2 works in regular print AND renditions why did I mention Method 1?

      • Renditions sets a whole bunch of environment variables that can be used. Every projectwise project property, document attribute and other metadata is available.
        • See: Environment variables set by rendition service for character substitution - Content Publishing Wiki - Content Publishing - Bentley Communities
      • The Connect documentation of design scripts specifically says PW_MASTER_FILE_URL is not implemented, so it shouldn't work. No idea if this means it'll be pulled in the future or maybe i just haven't seen the scenario where it doesn't work or maybe the documentation is just wrong.
        • See: Keywords Not Implemented (bentley.com)

      This is what the 2 methods produce for me in my test:

       

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Oct 7 2021 10:58 AM in reply to Kevin van Haaren

      And every variable Renditions sets should be set as variables, or as Item types, in MicroStation itself by ProjectWise integration. They are all super useful beyond text substituion.

       

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

    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