Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

[API] SelectByID2 trouble

Status
Not open for further replies.

binoyte

Mechanical
Jan 25, 2016
2
0
0
GB
Hi there

I've the same need and the same issue as reported here : where no solutions was found.

Code:
boolstatus = Assembly.Extension.SelectByID2("Point1@Origine", "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
    boolstatus = Assembly.Extension.SelectByID2("Point1@Origine@tibia-1@assieme", "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
    boolstatus = Assembly.Extension.SelectByID2("Point1@Origine@punta-1@assieme", "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
    
    Set myMate = Assembly.AddMate3(20, 0, False, 0, 0, 0, 0, 0, 0, 0, 0, False, longstatus)
    Assembly.ClearSelection2 True

The trouble is not in the addmate() method, but ins the selectionByID2(). Boolstats is false, and I don't understand why.

Thanks in advance for your help
 
Replies continue below

Recommended for you

Hi,

Try to avoid using SelectByID2 for selection unless the permanent name is used. Please note that the sketch elements such as sketch segments or sketch points have temporary names. So 'Point1' is assigned dynamically and can change later. Furthermore SelectByID2 is a view specific method for some elements. That means if the selection target is not visible in the view (like out of the view boundary or overlapped by another entity) selection may fail.

You need to use SketchPoint::Select4 method for selecting the points.

Thanks,
Artem
 
Status
Not open for further replies.
Back
Top