V8i SS3 VBA
Hi, I am trying to
1. Read the current status of the "ACS Plane" Lock and the "ACS Plane Snap" Lock
2. Save the Boolean values of the locks
3. Execute VBA code.
4. Reset the "ACS Plane" Lock and the "ACS Plane Snap" Lock back to their original Boolean status.
I think the settings I am looking for are ActiveSettings.ConstructionPlaneLockEnabled and ActiveSettings.DepthLockEnabled but I can't seem to be able to read their "True" or "False" status
Any help would be much appreciated.
Hi Thor,
for ACS Plane Snap Locak you can use:
' Retrieve ACS Plane Snap lock state lockState = GetCExpressionValue("tcb->ext_locks.snapCnstplane") ' Set ACS Plane Snap lock state SetCExpressionValue "tcb->ext_locks.snapCnstplane", lockState
I was not able to find what tcb variable is used to store ACS Plane lock. But I expect somebody from Bentley will know it.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Bob,
Unknown said:For MicroStation VBA you can send the following ACS key-ins; using CadInputQueue.SendKeyin
Yes, but it works only if you want to set the state. But how to read the states?
Here is a sample subroutine to get the ACS plane lock and snap states:
Sub GetACSPlaneLockSnapStates() ' Get ACS Plane Lock/Snap states. Key-ins: LOCK ACS TOGGLE, LOCK SNAP ACS TOGGLE Debug.Print "ACS Plane Lock: " & IIf(GetCExpressionValue("tcb->cntrl1.cnstplane"), "Enabled", "Disabled") Debug.Print "ACS Plane Snap: " & IIf(GetCExpressionValue("tcb->ext_locks.snapCnstplane"), "Enabled", "Disabled") End Sub
HTH,Bob
Unknown said: Did you try GetCExpressionValue("tcb->cntrl1.cnstplane") practically?
Did you try GetCExpressionValue("tcb->cntrl1.cnstplane") practically?
Seems to be working for me using v08.11.09.459.
Thor,
What exactly do you think ACS plane lock controls that you want to save/set/restore it? What ACS plane lock actually controls is whether the standard view rotations and AccuDraw shortcuts for the standard view rotations are relative to the ACS vs. design coordinates. It does not control whether un-snapped points are project to the ACS plane, this is now always the case since the removal of "depth" lock/active depth. It is very likely you don't need to do anything with this lock (the state of which is stored in the model header not the tcb). -B
Hi Phil,
Unknown said:Seems to be working for me using v08.11.09.459.
Thanks for the testing. It's weird, because GetCExpressionValue("tcb->cntrl1.cnstplane") returns always 0 in my installations. I even created a fresh testing environment in Azure to be sure there is no conflict with other installed products.
But it's a minor issue and I will not test it further as I agree with Brien the discussion what is the purpose and target of the original question would be more valuable.
Thor - Microstation V8i (Select Series 3) -Version 08.11.09.459
Answer Verified By: Thor
Unknown said: Can anyone point me to where to update my signature so that I can get the version right?
Can anyone point me to where to update my signature so that I can get the version right?
Sure... after you are signed in, go to http://communities.bentley.com/user/settings and scroll down to Signature, make the appropriate changes, then scroll to the bottom of that page and click "Save".
CADInputQueue.SendKeyin("Lock ACS Toggle;Lock ACS Toggle");
Then judge if MessageCenter.GetMessage(0).Message contains "ACS".