×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro to Create Plan View Camera (under View > Named Views)

Macro to Create Plan View Camera (under View > Named Views)

Macro to Create Plan View Camera (under View > Named Views)

(OP)
I am in need of a VBA macro that creates a camera for a standard, 3rd angle projection, plan view (Looking in -Z, +Y is up, +X to the right), then I need to "activate" that view (so the part orients to the camera created)...but I a not sure where to start.
-I have point coordinates where I could set my ViewPoint3D (if that is possible)
-The -Z is the SightDirection
-The +Y is the UpDirection
Any help would be greatly appreciated.

RE: Macro to Create Plan View Camera (under View > Named Views)

(OP)
Fernando,
This was exactly what I needed! I modified the "custom" view to the vectors I needed, and had to comment out the type on the Viewer3D (function marked as restricted) and it worked perfectly! Thanks!

Where are all these example scripts stored? I had to search for the file name you posted.

RE: Macro to Create Plan View Camera (under View > Named Views)

(OP)
Do you have anything creating TPSview planes for 3-D annotations? I can create the views but I am having trouble orienting the views to make the text go in the direction I want.

RE: Macro to Create Plan View Camera (under View > Named Views)

that is tricky as API not documented if my memory is good.

Do you have code we can look at?

Eric N.
indocti discant et ament meminisse periti

RE: Macro to Create Plan View Camera (under View > Named Views)

(OP)
Sure, so I thought the TPSViews were only related to how the geometry was oriented. So if I wanted to view my text in the plan view I needed to orient the geometry in the plan view before creating the TPSView.

So I would use the code above to orient to the plan view, create my annotation set, then I used the following code to create the view:

oSelection.Clear

oSelection.Add oPlane

oRefPlane = oSelection.Item(1).Reference

oView = oTPSFactory.CreateView(oRefPlane, 1)

oView.Name = "View Name"

oSelection.Clear

The view is created but the text was bout oriented properly. Horizontal was in the Y (up). There is a field in the TPSview definition (I'm using V5 R22) that allows you to align the horizontal of the view to a line...not sure how to access that in VBA though. The chm does not give good information on TPSViews.

RE: Macro to Create Plan View Camera (under View > Named Views)

i remember I had to first create a AXIS // to screen with vector matching screen vertical using ViewPoint3D.PutSightDirection and ViewPoint3D.PutUpDirection.
I used this axis in the creation of the view.

That was a while ago... have to go back to code to find out, but wont be able to share code (sorry)

Eric N.
indocti discant et ament meminisse periti

RE: Macro to Create Plan View Camera (under View > Named Views)

(OP)
So I figured out if you create a plane from 2 lines that are perpendicular (pick horizontal then vertical), then create a TPSView on that plane, the view horizontal and vertical will match the plane's horizontal and vertical.

RE: Macro to Create Plan View Camera (under View > Named Views)

that's why we created an Axis that would match the screen orientation...

Eric N.
indocti discant et ament meminisse periti

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources