Convert TP route to normal part

Convert TP route to normal part

salariua
Mentor Mentor
2,431 Views
29 Replies
Message 1 of 30

Convert TP route to normal part

salariua
Mentor
Mentor

Hi guys,

 

I just wonder if there's a bit of code that can convert a tube and pipe route to a normal part. 

 

Several reasons for this but main one would be to edit the 3D sketch without being in the main T&P assembly (lost, corrupted, etc.)

 

Now there's a code for un-authoring T&P fittings here:

http://knowledge.autodesk.com/support/inventor-products/troubleshooting/caas/sfdcarticles/sfdcarticl...

or here (same link) in case one goes dead over the years.

http://usa.autodesk.com/getdoc/id=TS13404549

 

and i was wondering if there's a Property Set that works for routes.

 

 

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Accepted solutions (2)
2,432 Views
29 Replies
Replies (29)
Message 21 of 30

Yijiang.Cai
Autodesk
Autodesk

Please see the attached part, and we could generate one new part based on the route part using macro. 

1. please download the file

2. Right-click, and select finish route

3. Tools -> Macro, and run the macro "Test"

 

The new part is generated. Please save it. And please restart Inventor and load the new part. 

 

Does it work fine for you?

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 22 of 30

salariua
Mentor
Mentor

Thank You Cai

 

Absolutely brilliant!

 

 - Could you please advice on why the Inventor restart? It seems to be working without.

 

 - Do we need to have just the route open? I see the macro will only affect he current file or will it affect other open files?

 

I’ll buy you a beer but meanwhile can I ask you to test the attach file?

Sorry for being such a bad sport but I am having problems processing construction lines and bends.

 

I am mostly thinking about doing my handrails that need construction lines to align segments and custom bends for changing direction.

 

thumb.jpg

 

 

Nonetheless fantastic workaround.

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 23 of 30

Yijiang.Cai
Autodesk
Autodesk

The macros only works fine for the route which only contains 3d sketch lines. And you could copy the VBA code from VBA editor, and paste it to VBA editor for other files. That means this VBA macro also works fine for other file.

 

For the case which contains both 3d sketch lines and arcs, we need to enhance this macro.

 

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 24 of 30

Yijiang.Cai
Autodesk
Autodesk

I have enhanced the macro to support the case which constains both 3d sketch lines and arcs. Please see the attached part. For the flexible hose route, it does not support yet using this macro to convert it to normal part.

 

After converting it to normal part, the constraints like dimensions, geometrical constrains are also added to 3d sketch in normal part.

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 25 of 30

salariua
Mentor
Mentor

Thank You Cai,

 

I'll give it a try now.

 

In case of the hoses I don't see the need to use the spline generated in T&P anywhere else.... but my mind keeps rolling.

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 26 of 30

salariua
Mentor
Mentor

Your code is even better many thanks.

 

Some issues I see:

 - We are adding constraints just not the same as in the original file, design intent is lost a bit.

 - All the included geometry is missing so the constraints too. We can stop using included geometry I guess.

- Construction lines are not getting trough. I guess we can stop using them if we need to export the sketch this way.

These are small issues we can live with but:

 - The sketch seems locked and nothing can be done with it. Like constrain it, add or remove segments, etc.

- The new sketch is also skewed and since we can’t edit it it’s not preserving the design intent(Look at the original and new file generated from TOP face of the cube).

- It has different coordinates (only checked starting point). Is this due to constraints being added afterwards?

I was hoping just constraining the origin plains would give us a similar design. As much as I like workarounds they are just that... workarounds.

 

There are 2 thinks we need really:

 - To be able to copy a 3D sketch just like a 2D sketch.

 - To have the 3D ortho tool available in 3D sketches.

 

I am willing to invest more time and test it out if you can help us improve the code.

It just seems we’re almost there so hope you can get back to us with new results.

 

Once again thank you Cai.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 27 of 30

Yijiang.Cai
Autodesk
Autodesk

I have updated the macro to cover the issue you posted. And the contruction lines are generated. The geometric constraints except for the coincident between lines and tangent between arc and line will not be generated.

 

Please see the attached file.

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 28 of 30

salariua
Mentor
Mentor

Thank You Cai,

Even better than before your code now.

I wonder what template Inventor uses because the new file is generated in cm instead of mm as the original file or my template.

I understand that I would be better off to constrain and dimension inside the exported 3D sketch rather than on the original file. Missing some dimensions like angular and radius but the main thing is that the sketch is still locked for edits.

Is this intentional?

 

150703-01.gif

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 29 of 30

Yijiang.Cai
Autodesk
Autodesk
Accepted solution

Please see the attached VBA code for macro, and I have fixed the template issue in the code. Please copy & paste the code to the VBA editor. And I also added the dimension for the arcs. For the angular dimensions and geometrical constraints, you could add them manually or you could also update the VBA code to add the dimensions and constrains you would like to add in the exported skecth. 

 

For the behavior related to sketch locked for edit, this should be an issue, and I have sent to development team to take a look.

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 30 of 30

salariua
Mentor
Mentor

Thank you Cai,

 

Finally managed to test it and it’s working except what you’ve mentioned: Restarting of Inventor.

 

Even if you close the file or run the code twice to generate a second copy (hopping it would clear the lock on the first one) the file generated will be locked until you open it with a fresh new Inventor session.

 

I think we’ve taken it as far as we could and this is a brilliant solution to be used until the 3D ortho tool becomes available outside T&P or until copy 3D sketch get’s implemented.

 

Once again thank you.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes