Inventor Customization

Reply
Member
Posts: 3
Registered: ‎10-19-2012
Message 1 of 6 (397 Views)

Assembly Features in Inventor 2012 API

397 Views, 5 Replies
10-19-2012 11:53 AM

Is the modification of weldment features in an assembly document supported in Inventor 2012's API? Considering the E_NOTIMPL message after trying a few methods, I assume it isn't.

 

Going off that, is there a good way to copy the ExtrudeDefinition and to assign a new Profile? Running the Copy method, and trying to alter the profile of that fails in a similar manner to working on the original. And looking from the object browser I can't seem to find a way to get enough information out of the Extent properties to clone it.

 

Since I'm not doing anything complicated, I can get everything working if I just fudge what it should be into the definition, but my inner perfectionist (and the part of me that doesn't ever want to touch this again) wants to scream if I do that.

 

Thanks for taking the time to read this, and I'll apologize in advance if there isn't enough information.

Employee
Posts: 403
Registered: ‎01-06-2009
Message 2 of 6 (388 Views)

Re: Assembly Features in Inventor 2012 API

10-22-2012 01:42 AM in reply to: mdevonb

Have you a VBA code sample to explain what you are going to do?



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Member
Posts: 3
Registered: ‎10-19-2012
Message 3 of 6 (381 Views)

Re: Assembly Features in Inventor 2012 API

10-22-2012 06:06 AM in reply to: mdevonb

Well, just as a quick bit of untested C# code ( I could spend the few minutes to rewrite it in VBA if you need )

ExtrudeFeature EF = weldComponentDefinition.Features["Extrude Test"];
EF.Definition.Profile = MagicProfileGenerationFunction();

 Would throw an E_NOTIMPL on the second line.

 

ExtrudeFeature EF = weldComponentDefinition.Features["Extrude Test"];
ExtrudeDefinition ED = EF.Definition.Copy();
ED.Profile = MagicProfileGenerationFunction();
EF.Definition = ED;

Line 4 of this also throws E_NOTIMPL. I remember a test I was doing on Friday throwing E_NOTIMPL on Line 3, but it's not happening today for whatever reason. So, now just deleting the ExtrudeFeature and creating a new one works fine.

 

As for the cloning, it seems I just didn't look hard enough. I looked at the PartFeatureExtents class, and didn't notice any derived classes.

 

Thank you for your response though. If you know of any way to do the above without having to create a new ExtrudeFeature, I would greatly appreciate being told, if there isn't feel free to forget about the thread.

Employee
Posts: 403
Registered: ‎01-06-2009
Message 4 of 6 (375 Views)

Re: Assembly Features in Inventor 2012 API

10-23-2012 02:27 AM in reply to: mdevonb

Maybe I need your data to learn which profile you are going to change for the extrude feature definition. But before asking for the data, can you make sure in UI when you edit the extrude feature you are able to change its profile to the one you specified in the MagicProfileGenerationFunction? I mean is that the profile you want to change to is from the same sketch as the current extrusion profile?



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Member
Posts: 3
Registered: ‎10-19-2012
Message 5 of 6 (368 Views)

Re: Assembly Features in Inventor 2012 API

10-23-2012 05:55 AM in reply to: yuhanzhang

Based on your response, modifying the profile of an assembly feature is implemented in IV2012's API then?

 

Back to what you asked, profiles are on the same sketch, and using the UI to change it works perfectly. Modifying the code to work on a part file, rather than an assembly, also works.

 

And I'm attaching a ZIP with a sample IPT, IAM and code in both C# and VBA. Code should swap between the 2.54CM profile and the 5.08CM profile for extrusion TX, based on the triangles in sketch TS. Both throw E_NOTIMPL when trying to assign the profile.

Employee
Posts: 403
Registered: ‎01-06-2009
Message 6 of 6 (359 Views)

Re: Assembly Features in Inventor 2012 API

10-23-2012 08:25 PM in reply to: mdevonb

I double checked this function in assembly/weldment, and confirmed this is not implemented yet. I will file this issue with number 1477509, you can track its status with providing this number to us.

 

Sorry for any inconvenience.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube