Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

trimetric view macro I'd like to share

Status
Not open for further replies.

jistre

Mechanical
Oct 1, 2003
1,147
I have a macro I wrote that I'd like to share. It's pretty nifty in that it pulls up dialogs that let you specify precisely where you want the view to be. It allows you to specify the angles between your viewpoint and the top and right planes. Then radio buttons allow you to specify whether you want to be above or below the top plane, in front of or behind the front plane, and whether you want to rotate CW or CCW about the Y axis. The large create button will position the view as specified and if that's not to your liking, you can change the variables and hit create again to change it until it's as you want. Then you can name the macro as you wish or keep the default. Finally, when everything's to your liking, you can hit the done button, and only then with the view actually be created and inserted into the view listing.

The problem is that the main routine of the macro simply calls up a user form and ends. The actual computations and manipulations are done from within the form, and while I can post that code easily, the information about the form's layout and naming conventions are lost, and the code is useless without that. I guess what I'm looking for is some way to post the binary. I know that brings with it all kinds of problems, but it can be reviewed for bugs/malicious code by both the moderators of the site and the people who download it.

I simply don't know enough VBA to create the form completely within the main code of the macro.
 
How Do I Make Files Available For Download? ... No Emails Required faq559-1177

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
Post it and let us try it. I have tried a macro to help you set up your view called "setcamera.swp" found at (the file is called "mm_20"). It's not very easy to set your view with this macro though.

Flores
SW06 SP3.0
 
Thanks, CorBlimeyLimey.

Here is the macro. Feel free to spread it around, modify, and keep it alive as needed.


I'm also interested in hearing about your thoughts on it. Here's a better description of the macro.

I tried to make this intuitive without having to worry about right hand rules and placements and such. When the macro runs, a dialog box will come up and you'll have several selections to make to pin down which of the 8 sectors of space around the part the viewpoint will be in. You select each of the three hemispheres you wish and that sets the initial position of the camera. If you pick back, right below, then the camera will be positioned below the part and behind it on its right side. All three directions are taken relative to the part.

Next, there are three text boxes. The first two allow you to specify the viewpoint angle as measured from the top and right plane. If you enter 15 as the measurement from the top plane and have selected "below" in the option buttons, the camera will be 15 degrees below the top plane. A similar procedure works for the second text box. Finally, the last text box allows you to give this view whatever name you want

Once you have all the parameters entered, press the "preview" button. The macro will then position the camera as you told it to. If you don't like the view, simply adjust the settings and keep hitting preview until you get the view you want. When the view is to your liking, click the "save" button, and the macro will then create the viewpoint with the name you gave it in the viewpoint manager. Now, you're free to create another viewpoint.

At any time, if you press the exit button, the macro ends and does nothing further.

I hope someone finds this useful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor