×
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

[API] SelectByID2 trouble

[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.

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

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

RE: [API] SelectByID2 trouble

(OP)
ok thanks i'll try this method.

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