Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

SolidWorks API: SelectByID

Status
Not open for further replies.

discofish

Computer
Dec 3, 2002
5
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?
 
Replies continue below

Recommended for you

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
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor