Please refer to the code.
First question: How to get focus by program:
-
Install the plugin MMArc.
-
Please run command ‘mma’ first, it will popup a dockbar, which has a Wall tab and a Door tab.
each tab has a button, let me call them wall-button and door-button.
You can find code "RunScript(“mmaWall”, true); " in UcBuilding.cs. -
Click on the wall-button to draw a wall, then I must click on rhino view to get the focus, and then click second time
to start draw wall. My problem is how to omit the first click?
Code in WallCommands.cs. -
Run command ‘mmaDoorType’ to create a door instance definition “M-1”.
Code in DoorTypeCommand.cs. -
Click on the door-button to insert a door, same thing happened, first click to get focus, second click to insert the door,
How to omit the first click?
I know that this problem will not happen if type in the command manually or using .rui, but I must solve the problem because
I have many controls on the dockbar.
You can find code "RunScript(“mmaDoor”, true); " in UcBuilding.cs, command code in DoorCommands.cs.
Second question: How to add an object to display it differently in different viewports?
6. Observe the inserted door. A Brep and two Curves made up the door. How can I make the curves display on TopView only,
and breps display on other viewports except TopView?
When the document save as .dwg file with TopView selected, I hope the .dwg file only contains curves without the breps.
Would you please help me add some code to get the effect?
Code in DoorTypeCommand.cs.
Thank you!
Manhong Chen
MMArc-Simplified.rar (4.5 MB)