I am having to change the settings > Design File>Working Units. I have tried the VBA record over and over It seems to record some of it
in a Macro9ModalHandler, I actually have a 6, 7, 8, and the 9
but when you run the macro, does not seem to make the changes
the Key-In "set units inches inches" works fine but I need Inches Custom
This is the starting format
This is what I am trying to achieve , how ever possible KeyIn or VBA, Next is the Custom Window and the settings needed
This is Custom Settings
Now I will put up the 1 of many test Macros trying to achieve this
Sub Macro12() 'Dim startPoint As Point3d 'Dim point As Point3d, point2 As Point3d Dim lngTemp As Long ' Send a keyin that can be a command string CadInputQueue.SendKeyin "set units inches inches" CadInputQueue.SendKeyin "Set" Dim modalHandler As New Macro12ModalHandler AddModalDialogEventsHandler modalHandler ' The following statement opens modal dialog "Design File Settings" ' Start a command CadInputQueue.SendCommand "MDL SILENTLOAD DGNSET" CadInputQueue.SendCommand "MDL SILENTUNLOAD DGNSET" RemoveModalDialogEventsHandler modalHandler CommandState.StartDefaultCommand End Sub
This is the 12th attempt with VBA record, finally the Macro12ModalHandler
Option Explicit Implements IModalDialogEvents Private Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult) End Sub Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, DialogResult As MsdDialogBoxResult) If DialogBoxName = "Design File Settings" Then ' The following statement opens modal dialog "Define Custom Units" ' Set a variable associated with a dialog box SetCExpressionValue "dgnSet.cust_customSU", 1, "DGNSET" SetCExpressionValue "dgnSet.cust_subNumerator", 10, "DGNSET" SetCExpressionValue "dgnSet.subUnitInfo.label", "TH", "DGNSET" ' Remove the following line to let the user close the dialog box. DialogResult = msdDialogBoxResultOK End If ' Design File Settings If DialogBoxName = "Define Custom Units" Then ' Set a variable associated with a dialog box SetCExpressionValue "dgnSet.cust_customSU", 1, "DGNSET" SetCExpressionValue "dgnSet.cust_subNumerator", 10, "DGNSET" SetCExpressionValue "dgnSet.subUnitInfo.label", "TH", "DGNSET" ' Remove the following line to let the user close the dialog box. DialogResult = msdDialogBoxResultOK End If ' Define Custom Units End Sub
Not sure what else to put, I have looked in help, VBA help and Online, Jan hope this is correct ?