Completed Macro for View Attributes

I sure hope this is the correct Form to post this on ? If not plese, please let me know where to put the question. If I ever get this completed it would save me a lot of time, opening and closing drawings with those attributes set correct.

Attached are two attempts to make a completed macro First VBA and then even a Basic one. They both failed the same way. The did not pickup the [Apply] button when pressed with the mouse during the recording and they did not pick up the [X] Close. I am attaching the screen shot with hopes of getting some assistance on this on going problem.

 

 

 

12:35 PM 5/5/2011 Set Attributes Select Box
Sub Macro1()
' 05/05/11 - Tried again to set "Settings, View Attributes, DataFields ON, LineWeights Off, Press Select and then close"
' The record dose not pickup the select and the close ?
    Dim startPoint As Point3d
    Dim point As Point3d, point2 As Point3d
    Dim lngTemp As Long

'   Start a command
    CadInputQueue.SendCommand "DIALOG VIEWSETTINGS TOGGLE"

'   Set a variable associated with a dialog box
    SetCExpressionValue "msDialogState.viewSettingsP->view", 0, "MGDSHOOK"

    SetCExpressionValue "msDialogState.viewSettingsP->flags.ed_fields", 1, "MGDSHOOK"

    SetCExpressionValue "msDialogState.viewSettingsP->flags.line_wghts", 0, "MGDSHOOK"

    CommandState.StartDefaultCommand
End Sub

I am unable to get the Apply button into the macro and the [X] close button
Could I get some help?
I even went back and tried making an old Basic Macro with the same results.
The DataFields are checked on and the LineWeights are checked off,
but I still have to press [Apply] and then [X] close?


' Set Datafields on, Line Weights off

Sub main
    Dim startPoint As MbePoint
    Dim point As MbePoint, point2 As MbePoint

'   Start a command
    MbeSendCommand "DIALOG VIEWSETTINGS TOGGLE"

'   Set a variable associated with a dialog box
        MbeSetAppVariable "MGDSHOOK", "msDialogState.viewSettingsP->view", 0&

        MbeSetAppVariable "MGDSHOOK", "msDialogState.viewSettingsP->flags.ed_fields", 1&

        MbeSetAppVariable "MGDSHOOK", "msDialogState.viewSettingsP->flags.line_wghts", 0&
End Sub

Parents Reply Children
  • Inga, Thank you for the Tip, I saved it with all my notes I am keeping on MicroStation Information.

    Rather than using the View Attributes dialog, you can use this keyin string:

    set ed off;set weight off; selview 1;update 1

    If you want to add it to a BASIC macro, add this:

    MbeSendKeyin "set ed off;set weight off; selview 1;update 1"

    RJB Phillips III - Praise the Lord for His Mercy and Grace