×
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

SolidWorks API: SelectByID

SolidWorks API: SelectByID

SolidWorks API: SelectByID

(OP)
Has anyone tried using the ModelDoc::SelectByID function to select faces? I have, and no matter what the points come out hundredths and thousandths off.

I bascially need to place holes in various locations, is there a function that will move these types of features?

RE: SolidWorks API: SelectByID

Are you trying to select all the faces or just those you picked? If you select faces before running the macro (I think this will be the case) try to use
"Set select = modelDoc.SelectionManager",

count the selected items using
"NumObj = select.GetSelectedObjectCount"

for each NumObj control if it's a face using if...then...else
"If selMgr.GetSelectedObjectType(I) = 2..."

Finally get the face using
"Set SelectObj = selMgr.GetSelectedObject2(I)"

Hope that can help.

Regards

RE: SolidWorks API: SelectByID

(OP)
I need the program to select the points by itself.  The point locations are pulled from an MS-Access database at runtime and stored in Doubles. All I need is some way to accurately place holes using this data, and Im open to suggestions.

I have also tried to move the sketch (created by the hole wizard) by changing the location of the centerpoint.  I have tried the SketchPoint::SetCoords(xx,yy,zz) function, but for some reason, it does not allow me to set the point.

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