Cancel
Showing results for 
Search instead for 
Did you mean: 

Modeling -> Create new resource

Creator
Creator

Hi,

 

I want to create e new resource with the API (v. 11). In the software it works over the menu "Modeling" -> "Create Part/Resource" -> "New Resource" and choose the type!

 

I've tryed "CreateLocalComponent" and "CreateCompoundResource" but that's not what I want.

 

Can someone help me with some code?

 

Thanks

4 REPLIES

Re: Modeling -> Create new resource

Creator
Creator

Hi, me again.

 

I found out that I have to set the component type for the folder containing the "robots". Than I can "InsertComponent" in the TxPhysicalRoot with the special path. To select the path in the application the user gets a dialog. Is it possible to open this dialog over the API?

Re: Modeling -> Create new resource

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi SteffiFri,

 

Check this link

Some of the functionality is only available starting from V13.0.2

 

Do you want to insert existin .cojt file or to create a new one with new geometry?

 

Best Reagrds,

DianaG

 

 

Re: Modeling -> Create new resource

Creator
Creator

Hi,

 

thanks for the answer.

 

I checked the link, but I want to add an existing .cojt file. For now I use the FolderBrowserDialog, but this has no preview window! Maybe it is safer to write your own dialog with a preview window!

 

Thanks!

 

 

Re: Modeling -> Create new resource

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi SteffiFri,

 

Then you need only this part of the code:

//5. Import the new component
            TxInsertComponentCreationData insertData = new TxInsertComponentCreationData("comp1", path);
            ITxComponent comp = TxApplication.ActiveDocument.PhysicalRoot.InsertComponent(insertData);

You can implement your own command with UI that will show also preview.

 

 

Best Regards,

DianaG