I have the following, but cold not get the VBA to copy the added command?
12:01 PM 8/3/2010 - Copied from VBA Macro, but want to add the line below?
Sub LocksOn() Dim startPoint As Point3d Dim point As Point3d, point2 As Point3d Dim lngTemp As Long
' Start a command 08/03/10 - Tried to add the setting for the Unit Lock Distance, did not work CadInputQueue.SendCommand "LOCK GRID ON "
CadInputQueue.SendCommand "LOCK FENCE OVERLAP "
CadInputQueue.SendCommand "LOCK SNAP ON "
CadInputQueue.SendCommand "LOCK AXIS ON "
CadInputQueue.SendCommand "LOCK UNIT ON " ' 08/03/10 - Want to put this in VBA Macro MbeSetScaledAppVar "MGDSHOOK", "msDialogState.gridInfo.roundoffUnit", 0.0625# ' copied from old BASIC MACRO and it did work? CommandState.StartDefaultCommandEnd Sub
I just need to get help making the command above Mbe.............. Into a VBA so it will complete my Macro.
Inaddittion, can you add a command to a VBA Macro like the Control Key Ctrl and F4 key in a combination or the Alt key and F4?
I wanted to close the Window with the Red X and tried using Ctrl F4 and the window in Bentley closed. I tried the Key-in command with Ctrl F4 and nothing happened but when I do it from the key board direct it will close the window.
It is always best to set any dialog box settings via key-ins, whenever possible. A quick look in Help reveals the following:
Sets the distance, in working units, between points in the imaginary grid used by Unit Lock. Unit Distance takes effect only when Unit Lock is on. Key-in: ACTIVE UNITROUND <mu:su:pu> Key-in: UR= <mu:su:pu>
Sets the distance, in working units, between points in the imaginary grid used by Unit Lock. Unit Distance takes effect only when Unit Lock is on.
Key-in: ACTIVE UNITROUND <mu:su:pu>
Key-in: UR= <mu:su:pu>
So in your code you can use the following:
CadInputQueue.SendCommand "ACTIVE UNITROUND 0.0625 "
or
CadInputQueue.SendCommand "UR=0.0625 "
Charles (Chuck) Rheault CADD Manager
MDOT State Highway Administration
Richard,
Take a look at the attached MVBA project.It should give you at least a working starting point.
I am not sure what you want to accomplish with the Control Key + F4 or other keypresses.If you are setting values directly in code, in most cases there is no need for the other settings dialogs, you are bypassing that step.I think in this case the VBA macro recorder has led you down the wrong path.Note that if you do happen to have the dialog open, in most cases the check boxes with not update when you run the code.However, if you were to close the dialog and reopen so it can refresh itself, you would then see that the new settings have actually been applied.
Hope this helps.-G-
CadCop, Thank you for the assistance, will try and see what you mean by the help as well. Would this be help under the VBA or the general Help? I do want to thank you . I have managed to corvert most of my Basic Programs to VBA, they just need this little tweking.
RJB Phillips III - Praise the Lord for His Mercy and Grace
Finally back on line, been laid up since August 8th, thank you for the reply, I just found out by experment that some of the dialog boxes will close when you press Ctrl F4, so I wanted to try and duplicate that in a VBA macro and that wold close down the dialog without having to click on the X , one of the other dialog windows wants you to select [apply] or [all] which are both manual responses? Thanks so much for taking the time, Phil finally got me setup to get back on line.
How do I get the file you attached? the MVBA mentioned above.
Sorry I just found out it was above and clicked on it ......... Rihcard
Thank you for the information above on the unit setting, sometimes it pays to know where to look. I am finally back working part time, I am going to attempt this and thank you ....... Rihcard
Thank you so much for the above information, that was all I needed to complete a conversion from BASIC to the VBA Macro I made. What would you put in to set the radius CadInputQueue.SendCommand "ACTIVE radius 0.0 " I could really use an on the fly method for setting this as well, different macro