Work Smarter, Not Harder II
Sean 'Bear' Forward
Senior Structural Designer\CAD Administrator @ Universal Site Solutions
We're all wired differently. Me, I like to have things simplified when it comes to my tools. Like our first article on 'Work Smarter, Not Harder', this is where the VB Forms continue to make it easier to deliver a more cohesive interface.
This time we're going to have a look more at View tools:
As someone who likes to use full screen view for modelling and 2D, the key to making it all work seamlessly has been finding a way to switch between views quickly. In the past using the keyins to close and open a view has been cumbersome as it always meant time wasted when the view refreshes. To work around this we always had an mdl called 'viewfront'. This brought a view to the top without refreshing the view. With the Connect version we lost this tool as the changes in the program meant it no longer worked, but what we have also seen is a much more efficient program when it comes to busy models and rendered views. This means that we no longer need a custom tool, but can fall back on the keyins instead. For this we use:
Private Sub CommandButton1_Click()
CadInputQueue.SendKeyin "view off 1;view on 1"
End Sub
Private Sub CommandButton2_Click()
CadInputQueue.SendKeyin "view off 2;view on 2"
End Sub
and so on.
Screen 1 is views 1-4 and screen 2 is views 5-8. Get yourself into a good habit of how you have the views set up and you can very quickly swap between views to make it easier to model.
Next, is to bring the view rotation tools into one location:
With this I also add the Right Iso rotation that is not normally available. Having the single set of tools means I'm not waiting for view tools to expand off the view bar. Again, the buttons are just firing off keyins:
Private Sub ROT_Click()
CadInputQueue.SendKeyin "rotate view extended"
End Sub
Private Sub CommandButton20_Click()
CadInputQueue.SendKeyin "view TOP;view %d"
End Sub
Private Sub CommandButton10_Click()
CadInputQueue.SendKeyin "view ISO;view %d"
End Sub
If you've not used it before, using the keyin %d tells MicroStation to wait for a data point, a really handy keyin that can be used in many ways. This allows you to select the view you're going to rotate.
Next and very important tool is to quickly render the view.
It's a great way to check your modelling and see how it all looks. This is simply a toggle keyin that can be used against the view number:
Private Sub CommandButton22_Click()
领英推荐
Dim vw As View
Set vw = ActiveDesignFile.Views(1)
If vw.RenderMode = WireFrame Then
??CadInputQueue.SendCommand "CHANGE VIEW SMOOTH 1"
??Else
???
??CadInputQueue.SendCommand "CHANGE VIEW WIREFRAME 1"
??End If
End Sub
I find this much quicker than having to go to the view bar each time and the smooth render mode gives a nice, easy view to work with without it getting bogged down.
The last section are some nice to haves for me:
Lastly, don't forget to add some 'nice to have' tools. Just as an example from above:
CONS - is a button to toggle on and off construction elements in a view using the keyin:
Private Sub CommandButton15_Click()
CadInputQueue.SendKeyin "view CONSTRUCTION TOGGLE;view %d"
End Sub
Zoom - this is a really handy tool. It allows you to zoom into a selected element in a view and have the view clipped around the element.
Select the element:
Click on the ZOOM button and then click in the view:
Fit view expands the view back or keep a view set for this sort of work. This is where Viewfront can be handy as well.
I hope this inspires you to set up a view GUI of your own.
Until next time, happy fiddling.