How to add your knowledge

Use of the “Me” Object

    Table of contents
    No headers

    Workflow scripts are derived from the Autodesk.Map.IM.Workflows.ScriptClass abstract class. By using the Me object in the script, you can gain access to the many base objects and useful functions provided by ScriptClass.

    The following are the objects provided by the Me object. With these you can access all of the main features of the AutoCAD Map 3D environment and document data:

    • Application - This object contains information about the current working environment, the current user, and the open workspace and documents. It is a reference to the base application object derived from the Autodesk.Map.IM.Forms.Application abstract class.
    • Document - This objects allows you to interact with the document that this workflow is part of, including displaying dialog boxes or closing the document. It is a reference to one of the documents in the current workspace, an object derived from the Autodesk.Map.IM.Forms.Document abstract class.
    • Features - This object provides methods for accessing and modifying the list of features that were just recently digitized. It is an instance of the Autodesk.Map.IM.Workflows.Features class.

      The following is an example using the Me object:

      ' Digitize a new pipe and then display a message box with
      ' the feature ID of the newly created feature.
      Me.Digitize("DEMO_PIPE")
      Me.MessageBox(Me.Features.ListItem(0).Attributes.Item("FID").Value)
      

    The following are some of the useful methods provided by the Me object:

    • ShowMessage() - Hides any explorer currently displayed in the AutoCAD Map 3D task pane and displays a string message inside. When the workflow ends, the AutoCAD Map 3D task pane reverts to its previous state.
    • MessageBox() - Displays a standard message box with a single “Ok” button and a single string message with an optional title. Processing of the workflow pauses until the message box is dismissed.
    • InputBox() - Displays a standard input box allowing the user to input a string value. Processing of the workflow pauses until the input box is dismissed.
    • Digitize() - Allows the user to add features of the specified feature class to the document.
    • RunMethod() - Runs a method from an external .dll library. The most important use of RunMethod is to launch workflow plugins.