Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with Factory property MemberNameIndexInitialValue usi

1 REPLY 1
Reply
Message 1 of 2
wazydotnet
302 Views, 1 Reply

Problem with Factory property MemberNameIndexInitialValue usi

When using Factory passing a value tp MemberNameIndexInitialValue in c# the compiler will not let me use a long.

I cast ant and then got a COM Error not the right type.

Any one got any ideas 

API info says an unsigned long

I have tried system int, int32 ulong etc

int x = 0;

MemberNameIndexInitialValue = x;

COM Error

 

1 REPLY 1
Message 2 of 2

int declaration work fine in c# but you cannot assign zero value to MemberNameIndexInitialValue property. It must be >= 1, otherwise you get runtime error ("The parameter is incorrect...").

The following code works for me:

PartDocument oiPartDoc = (PartDocument)ThisApplication.ActiveDocument;   
iPartFactory oFactory = oiPartDoc.ComponentDefinition.iPartFactory;
FactoryOptions oOptions = oFactory.FactoryOptions; 
int x = 9;
oOptions.MemberNameIndexInitialValue = x;
oiPartDoc.Update();  

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report