[API] SelectByID2 trouble
[API] SelectByID2 trouble
(OP)
Hi there
I've the same need and the same issue as reported here : http://www.eng-tips.com/viewthread.cfm?qid=291429 where no solutions was found.
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
I've the same need and the same issue as reported here : http://www.eng-tips.com/viewthread.cfm?qid=291429 where no solutions was found.
CODE --> vba
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






RE: [API] SelectByID2 trouble
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
RE: [API] SelectByID2 trouble