I USE MICROSTATION V8I
1.changing multiple sheets numbers using VBA?
Page numbers are in series 1,2,3---in tags?
2.I have record a VBA fr editing tags text when i play vba i need to press ok and close tag edited dialog box and then it goes for next tag edit
in need help that dialogue box should get close by itself so the VBA works without any interrupt
please give me solution for this if anyone knows solution to it Thank yoiu
King Khan said:dialogue box should get close by itself so the VBA works without any interrup
It's hard to comment without seeing your code. Post your recorded macro!
Regards, Jon Summers LA Solutions
Thanks MR Jon for your answer
please check the VBA code below
When i play a vba for multiple file i need to prees ok
Sub CHANGE() Dim startPoint As Point3d Dim point As Point3d, point2 As Point3d Dim lngTemp As Long
' Start a command CadInputQueue.SendCommand "CHOOSE ELEMENT"
' Coordinates are in master units startPoint.X = 0.850813363321741 startPoint.Y = 1.26048427622663E-02 startPoint.Z = 0#
' Send a data point to the current command point.X = startPoint.X point.Y = startPoint.Y point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
point.X = startPoint.X + 0.168345907741465 point.Y = startPoint.Y - 4.30446269439775E-03 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
' Set a variable associated with a dialog box SetCExpressionValue "powerSelectInfo.prefs.currSelBy", 0, "PSELECT"
CadInputQueue.SendCommand "POWERSELECTOR SINGLE"
point.X = startPoint.X - 2.65327789375136E-03 point.Y = startPoint.Y + 1.83168625293566E-04 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
Dim modalHandler As New Macro1ModalHandler AddModalDialogEventsHandler modalHandler
' The following statement opens modal dialog "Edit Tags [SEEDS2TBLK]"
' Send a keyin that can be a command string CadInputQueue.SendKeyin "edit tags"
CadInputQueue.SendKeyin "choose element"
point.X = startPoint.X + 2.87285951254457E-02 point.Y = startPoint.Y - 8.79209401408909E-03 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
CadInputQueue.SendKeyin "edit tags"
point.X = startPoint.X + 1.49916736164175E-02 point.Y = startPoint.Y - 1.47319908628934E-02 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
point.X = startPoint.X + 2.31475623144514E-02 point.Y = startPoint.Y - 4.04802661898686E-02 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
point.X = startPoint.X + 0.031303451012485 point.Y = startPoint.Y - 3.90149171875204E-02 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
point.X = startPoint.X + 4.42692227888464E-02 point.Y = startPoint.Y - 3.90149171875204E-02 point.Z = startPoint.Z CadInputQueue.SendDataPoint point, 1
RemoveModalDialogEventsHandler modalHandler CommandState.StartDefaultCommandEnd Sub
do you know any solution to my first question please
1.changing multiple sheets numbers which are in tags using VBA?
King Khan said:do you know any solution to my first question
One question at a time, please!
Sorry please check the code and screenshot i have add to my previous reply
King Khan said:Dim modalHandler As New Macro1ModalHandler
You will find that the macro recorder has created a class module named Macro1ModalHandler. Please post that code.
Macro1ModalHandler
This one ?
Implements IModalDialogEventsPrivate 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 = "Edit Tags [SEEDS2TBLK]" Then
CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_1"
CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 123456"
' Remove the following line to let the user close the dialog box. DialogResult = msdDialogBoxResultOK
End If ' Edit Tags [SEEDS2TBLK]
CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_2"
CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 78910"
CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 11121314"
CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_3"
CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 111213141516"
CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG DRAWING_NO"
King Khan said:' Remove the following line to let the user close the dialog box. DialogResult = msdDialogBoxResultOK
You can see that you must edit the file if you want to change the behaviour. The default behaviour is that the dialog should close automatically, without the need to click the OK button. Investigate your code to find out why the dialog doesn't work the way you want.
You need to step through your code using VBA's debug tools. Function key F8 lets you step through your code.
Sorry i didn't get you. can you make changes in code and paste it over here so i can know clearly please
King Khan said:can you make changes in code
No! I haven't suggested that you make any changes. What I wrote was: You need to step through your code using VBA's debug tools. Function key F8 lets you step through your code.
I tried but it didn't work for me. still waiting for someone solution to my problem. if anyone now please help me with this thanks