Problem with Factory property MemberNameIndexInitialValue usi

Problem with Factory property MemberNameIndexInitialValue usi

Anonymous
Not applicable
589 Views
1 Reply
Message 1 of 2

Problem with Factory property MemberNameIndexInitialValue usi

Anonymous
Not applicable

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

 

0 Likes
590 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni

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

0 Likes