Trouble with Component Replace from an iPart to a regular Part. Mates blow up.

Trouble with Component Replace from an iPart to a regular Part. Mates blow up.

W.Scott.Dempster
Enthusiast Enthusiast
223 Views
2 Replies
Message 1 of 3

Trouble with Component Replace from an iPart to a regular Part. Mates blow up.

W.Scott.Dempster
Enthusiast
Enthusiast

I am modifying an existing macro. In a nutshell, what it does is does is creates a copy of a part, creates a copy of that part's drawing and inserts the copy into that drawing, and does a Component Replace inside the active Assembly file when the macro was ran. In essence just creates a new Part file and Drawing file based off an existing Part file. Works great.

 

The issue now is that we moved on to using iParts. If I am looking to Replace an iPart with a normal version of itself (basically first deleting the iFactory before replacing) the mates blow up.

 

What should I try doing in my macro to preserve mates?

0 Likes
224 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor

Hi @W.Scott.Dempster 

I guess this will depend what object you are using for mates. Are you using origin planes or custom workplanes or proxy faces or named faces etc? 

 

Have you tried the workflow manually and still get the same result as by code? This generally will point to what the issue is and you can eliminate any code related errors. If you can share any error messages and images of the browser tree with broken constraints. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

Frederick_Law
Mentor
Mentor

The drawing should not use the Factory, it should use the instance.

iPart/iAssembly Factory will create a folder and all used instance in that folder.

Drawing and assembly should use those files instead of the Factory.

I don't remember if mates stay with iPart.  I think it does.

 

Another way is ModelState.

Just did a few SaveAs drawing and replace with another ModelState.

Works great.

0 Likes