cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Adding a flexible part to an assembly_OTK Java

VladiSlav
17-Peridot

Adding a flexible part to an assembly_OTK Java

Hello to all!
Please tell me how to add a part to an assembly using OTK Java and make this part flexible.
I watched the otkAssemblyItemOperationsExample example, but it does not work.

Because the assembly is done according to a predefined structure:

/* ---------------------------------------------------
    * ASSEMBLY STRUCTURE USED FOR THE EXAMPLE *
---------------------------------------------------
							---------		-------
							 FEAT ID 		 FEAT #
							---------		-------
FLEX_TOP_ASM.asm
|
|---ASM_RIGHT						    1  	 		   1
|---ASM_TOP						    3			   2
|---ASM_FRONT						    5			   3
|---ASM_DEF_CSYS					    7			   4
|
|===FLEX_PART2.prt					   39			   5
|
|===FLEX_SUB_ASM1.asm					   42			   6
	|
	|---ASM_RIGHT				    	    1			   1
	|---ASM_TOP					    3			   2
	|---ASM_FRONT					    5			   3
	|---ASM_DEF_CSYS				    7			   4
	|
	|===FLEX_PART1.prt				   39			   5
	|
	|===FLEX_SUB_ASM2.asm				   40			   6
		|
		|---ASM_RIGHT				    1			   1
		|---ASM_TOP				    3			   2
		|---ASM_FRONT				    5			   3
		|---ASM_DEF_CSYS			    7			   4
		|
		|===FLEX_PART1.prt			   39			   5
		|===FLEX_PART2.prt			   40			   5
			
---------------------------------------------------
    * ASSEMBLY STRUCTURE USED FOR THE EXAMPLE *
--------------------------------------------------- */

But I don’t know where to get the incoming parts and assemblies (FLEX_TOP_ASM.asm, FLEX_PART2.prt, and so on).
Yours faithfully!

1 ACCEPTED SOLUTION

Accepted Solutions

Starting from Creo Parametric 3.0 M180 and Creo Parametric 4.0 M060

New functions introduced:

wfcFeature.WFeature.ListVariedItems

wfcFeature.WFeature.ListVariedParameters

 

I think, need to make this steps:

  1. get flexible component
  2. using this component (feature) get an array of all items (dimensions, features...)
  3. find needed dimension from array
  4. set new value for this dimension as usual

View solution in original post

9 REPLIES 9

Hello everybody!
I created a flexible item.
can you please tell me how to manage the flexible parameter now?
What methods are needed for this?

See chapter in User's Guide "Variant Items for Flexible Components"

Hello!
I watched
But I couldn’t do what I wanted to do.

Снимок.PNG

Regards!

Can you provide more info about what you want to do with flexible items?

Oh sure.
I add the part (conditionally cube) to the assembly.
I make this part flexible (one of its dimensions becomes changeable in the assembly).
I did all this programmatically.
Now I need to access this flexible size and resize it. This also needs to be done programmatically.
Respectfully!

I think, you can found what you want in ...\Common Files\otk\otk_java\otk_java_examples\otkAssemblyItemUtils.java

I looked at this file.
It describes how to create flexible elements, but not how to manage them, as I understand it.

Starting from Creo Parametric 3.0 M180 and Creo Parametric 4.0 M060

New functions introduced:

wfcFeature.WFeature.ListVariedItems

wfcFeature.WFeature.ListVariedParameters

 

I think, need to make this steps:

  1. get flexible component
  2. using this component (feature) get an array of all items (dimensions, features...)
  3. find needed dimension from array
  4. set new value for this dimension as usual

Thanks a lot!!!

Respectfully!

Top Tags