×
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

Programming: Get Coordinates in Model View

Programming: Get Coordinates in Model View

Programming: Get Coordinates in Model View

(OP)
Does anyone know how to determine the coordinates in model view when the Solidworks window is active even if nothing is selected?  I am trying to relate mouse coordinates to the 3 dimensional coordinates of the model view window in solidworks.  Thanks for the help.  

RE: Programming: Get Coordinates in Model View

I was trying to do the same thing a while back (I was unsuccessful).  PLEASE let me know if you make any progress.

Someone said I would need to make use of a subclassing method to do this, but that is a very advanced and not-so-simple method of VB programming.

I was working on a macro that would insert a component into an assembly by just typing in the part number (no need to browse to the component).  Problem was, I could not convert the mouse position coordinates to model space coordinates when the user clicks the mouse in open space (like the regular 'insert component from file' works).

I ended up requireing the user to click on the model to get a 3D point in model space for my macro as a location to insert the component.  If nothing is selected, the component is inserted at 0,0,0.

Again, PLEASE let me know if you make any progress.

Thanks.

RE: Programming: Get Coordinates in Model View

I'm not surprized you had trouble, Arlin. Even if you did manage to get the mouse coordinates (there is a command in the OpenGL api, I think), it would probably be in the terms of the number of pixels from the the top lefthand corner. You would then need to find out the exact position of the model window in pixels so you can tell if the mouse is inside the model window. Then you would have to map the mouse coordinates into the model coordinate system. I have no idea how SolidWorks even does this, but I think it would be really quite difficult.

I'm knackered just thinking about it...

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