Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Wiki Exploring The Possibilities Of Properties [CS]
    • Sign In
    • ProjectWise Design Integration Wiki
    • ProjectWise Software Download
    • +ProjectWise Learning
    • +Projectwise Licensing
    • ProjectWise Programming and PowerShell
    • +Projectwise Documentation
    • -ProjectWise Explorer Client
      • -ProjectWise Client
        • Actions that Automatically Lock and Check Out Files in ProjectWise Integrated Autodesk Revit
        • Assign Spatial Location to Digital Images
        • Assign Spatial Locations Your Way with VBA
        • Command Line Arguments
        • Creating PDF Files Containing Project Explorer Links [CS]
        • Deploying a Custom Toolbox [TN]
        • Enumfolders.exe  TN
        • Error 55011
        • Exploring The Possibilities Of Properties [CS]
        • How To Setup Attribute Bulk Update [TN]
        • Permissions in ProjectWise [TN]
        • ProjectWise BatchPlot Quick Reference [TN]
        • ProjectWise Explorer White-Screen Socket Close Failure [TN]
        • PWV8.BRG Information Is Now Stored in the Windows Registry TN
        • Reload Workspace Dialog
        • Right Click Document Folder Export, Tools Export Import Wizard, Export Import with Excel TN
        • Send To Options missing from PW Menu
        • Setting Preview On For Microsoft Office Documents [TN]
        • Sharing Customized Toolbars Among ProjectWise Users [TN]
        • Suggested Document Viewers [TN]
        • Using The ProjectWise API In VBA
        • Using The Workspace Profiles Capability In Bentley ProjectWise [CS]
        • Error 56013 Cannot login to the datasource. Invalid database name
        • How to upgrade Projectwise
        • ProjectWise Explorer shows the splash screen for a second and crashes
        • ProjectWise list of services and folders to exclude from a Virus Scan
      • +Featured Articles - Projectwise Explorer
      • +Audit Trail - ProjectWise Explorer Client
      • +Bentley IMS Login
      • +BS1192 Rules Engine - ProjectWise Explorer Client
      • +Check In Dialog - ProjectWise Explorer Client
      • +Document Code - ProjectWise Explorer Client
      • +Document Creation - ProjectWise Explorer Client
      • +Documentation & Help - ProjectWise Explorer Client
      • +Environments and Attributes - PWE
      • +Export / Import Tool - ProjectWise Explorer Client
      • +Folders / Subfolders - ProjectWise Explorer Client
      • +GUI - ProjectWise Explorer Client
      • +Installation - ProjectWise Explorer Client
      • +Integration - General
      • +Integration - AutoCAD - ProjectWise Explorer Client
      • +Integration - Civil 3D - ProjectWise Explorer Client
      • +Integration - DGN Platform - ProjectWise Explorer Client
      • +Integration - MicroStation - ProjectWise Explorer Client
      • +Integration - Office - ProjectWise Explorer Client
      • +Integration - Revit - ProjectWise Explorer Client
      • +Logs Troubleshooting- ProjectWise Explorer Client
      • +Messaging Service - ProjectWise Explorer Client
      • +MISC - ProjectWise Explorer Client
      • +Open / Save / Copy / Move - ProjectWise Explorer Client
      • +Photo Preview - ProjectWise Explorer Client
      • +ProjectWise Managed Workspaces
      • +Project - ProjectWise Explorer Client
      • +Search - ProjectWise Explorer Client
      • +Security and Permissions - ProjectWise Explorer Client
      • +User Tools - ProjectWise Explorer Client
      • +Views - ProjectWise Explorer Client
      • +Workflows & States - ProjectWise Explorer Client
      • +Network Configuration - Client
    • +ProjectWise Administrator
    • +ProjectWise Integration Server
    • +ProjectWise Caching Server
    • +ProjectWise Gateway Server
    • +ProjectWise User Synchronization Service
    • +ProjectWise Orchestration Framework
    • +ProjectWise Connected Services
    • +Working from Home with ProjectWise
    • +ProjectWise Glossary
    • ProjectWise Hosting - Manage Services
    • +ProjectWise Logging and Tools

     
     Questions about this article, topic, or product? Click here. 

    Exploring The Possibilities Of Properties [CS]


      

    This Client Server article is republished in its entirety from 2003 for reference purposes.

    Properties 

    Have you ever wanted to store more information against a DGN file for use later? Is your manager finding it hard to locate files? Would you simply like an automated title block updater like ProjectWise (we call this last one ProjectWise envy)?

    The answer is at hand. The only prerequisites are:

    1) Files are stored on NTFS partitions

    2) Your client machines are Windows 2000 or later

    3) MicroStation V8

    Since Windows 2000 was released, some nice things have been added to NTFS. For example, with most files, right clicking and selecting Properties will yield a Summary and possibly even a Custom tab. These tabs allow you to use default fields or to create your own. In this article, you'll learn to use some of these common fields and to create some of your own. Figure 1 displays a shot of the Properties dialog Summary tab.

     

    You can also have these default values as columns in your detail view in Windows Explorer. Right click on the Heading row.

    Some of these properties are also available via the File>Properties menu inside MicroStation V8.

    Most of these will provide basic information. For creating user-defined attributes, we have the Custom tab.

     

     

    Don't worry if you don't have a Custom tab right now. After following the steps in this article, you certainly will have one.

    Adding information into the File Properties>Summary Tab or the MicroStations File>Properties menu is easy enough. Let's take a look at how you might do this with some VBA code.

    Sub justStartingOut()

     

    ActiveDesignFile.Author = "Ron"

     

    MsgBox ActiveDesignFile.Author

     

    End Sub

     

     

     

    If you close the design file after running the code, you'll see this in the Summary tab (Figure 6):

      

    The following are now available (using the above ActiveDesignFile object):

    • .Author
    • .Client
    • .Comments
    • .Company
    • .Keywords
    • .LastSavedBy
    • .Manager
    • .Subject
    • .Title

    Not all of these properties correlate directly to the Summary tab, however. Some are also embedded in MicroStation itself:

    .Client will populate the category field in the summary tab.
    .Company will populate the properties in MicroStation only.
    .LastSavedBy will populate the properties in MicroStation only.
    .Manager will populate the properties in MicroStation only.

    You will need to determine what fields you will use to achieve your desired results. If you want as much information displayed as possible in the Windows Explorer Details view, you will use the following values, because all of them populate information into the Summary tab.

    • .Author
    • .Client
    • .Comments
    • .Keywords
    • .Subject
    • .Title

    By using these fields, and displaying the extra columns in Windows Explorer, people who are not familiar with document-coded filenames can look through other values to find the design file relevant to them.


    You may have a program that needs to store information against a design file

    For example: you may have a VBA program that displays a Web page with as-built photos is based against a design file. Or, another example: perhaps Bentley Redline is installed on the desktop, and an excel spreadsheet displays information regarding the estimated performance of items in our design file (And you thought Bentley Redline was only good for markups!).

     

    You can use engineering links to link the spreadsheet into a few elements. In order to do that, you would need to remember what elements are linked, or use the Show Engineering Links tool each time. Then you would need to format the link correctly, and then teach management how to use them.

     

    Take a look at the spreadsheet example.

     

    Creating a custom property in which to store some information requires nothing more than:

     

    ActiveDesignFile.SetCustomProperty "My custom property", "value"

     

    In our example, it would look like:

     

    ActiveDesignFile.SetCustomProperty "Excel_Linkage", "javascript:void(null);"

     

    This custom property will show up in the Custom tab, in the File Properties dialog (Figure 7).

     

    You can't leave it at that, so you would just snip in some code to read that value and open Excel too. It might go something like:

    Sub getCustomPropAndOpenExcel()

     

    Dim oExcel As Object

    Set oExcel = CreateObject("Excel.Application")

     

    If ActiveDesignFile.CustomPropertyExists("Excel_Linkage") Then

     

    oExcel.Workbooks.Open ActiveDesignFile.GetCustomProperty("Excel_Linkage")

     

    oExcel.Visible = True

     

    Else

     

    MsgBox "No linkage in this file"

     

    Set oExcel = Nothing

     

    End If

    End Sub

     

    When you go to read a custom property value, you need to first check that it exists. Simple error checking should always be done when you write programs. Users should never have to deal with runtime errors.

     

    If the value exists, get Excel to open the workbook, and show Excel on the screen.

     

    If the custom value doesn't exist, let the user know why nothing happened and close the Excel process.

     


    Why not try using the properties of a DGN file to update a tag set in your title block design file or placed cell?

     

    The example below hooks into a tag set called "TitleBlock" and a series of tags within that tag set. You can find this example tag set in the DGN files supplied in \Examples\Borders\ISO in the Workspace Projects directory.

     

    Sub updateTitleblock()

     

    Dim ee As ElementEnumerator

    Dim sc As New ElementScanCriteria

    Dim eleTag As TagElement

     

    sc.ExcludeAllTypes

    sc.IncludeType msdElementTypeTag

    Set ee = ActiveModelReference.Scan(sc)

     

    Do While ee.MoveNext

    Set eleTag = ee.Current

    If eleTag.TagSetName = "TitleBlock" Then

    eleTag.Redraw msdDrawingModeErase

    Select Case eleTag.TagDefinitionName

    Case "Drawn"

    eleTag.Value = ActiveDesignFile.Author

    Case "DWG No"

    eleTag.Value = ActiveDesignFile.Name

    Case "Title"

    eleTag.Value = ActiveDesignFile.Title

    Case "Drawn Date"

    eleTag.Value = Date

    Case "Rev."

    If ActiveDesignFile.CustomPropertyExists("Rev.") Then

    eleTag.Value = ActiveDesignFile.GetCustomProperty("Rev.")

     

    End If

    End Select

    eleTag.Redraw msdDrawingModeNormal

    eleTag.Rewrite

    End If

    Loop

    RedrawAllViews

    End Sub

    I hope you have already discovered a use for properties in your organization.

    See Also

    Client Server Archive

    ProjectWise TechNotes And FAQs

    Comments or Corrections?

    Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!

     

    Original Author: Bentley Technical Support Group

    • ProjectWise SELECTsupport
    • client server
    • Share
    • History
    • More
    • Cancel
    • Elisa McGraw Created by Elisa McGraw
    • When: Fri, Jul 8 2011 10:58 AM
    • Dana Guthrie Last revision by Bentley Colleague Dana Guthrie
    • When: Fri, Oct 7 2022 3:26 PM
    • Revisions: 2
    • Comments: 0
    Recommended
    Related
    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