Inventor Customization

New Member
Posts: 1
Registered: ‎02-26-2013
Message 1 of 2 (139 Views)

Problem with Factory property MemberNameIndexInitialValue usi

139 Views, 1 Replies
02-26-2013 01:48 PM

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


ADN Support Specialist
Posts: 458
Registered: ‎08-14-2012
Message 2 of 2 (91 Views)

Re: Problem with Factory property MemberNameIndexInitialValue usi

03-04-2013 07:47 AM in reply to: wazydotnet

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;


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

You are not logged in.

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

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

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