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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Creating a simple 3D model using J-Link

VladiSlav
17-Peridot

Creating a simple 3D model using J-Link

Hello!

I am trying to create a simple model (for example, a cube) only using J-Link.
Started by creating a window:
      Model tryModel = curSession.CreatePart ("Testing1");
      tryModel.Display ();
But it does not appear (I call using the button from Creo).
Does anyone have experience creating models using J-Link?
Help me please.
Regards!

1 ACCEPTED SOLUTION

Accepted Solutions

Yep, in OTK JAVA is possible.

Take a look at chapter Feature Element Tree in documentation.

 

For J-Link:

1) Template parts with common geometry. Then you can drive a part by changing dimensions and parameters.

2) Build models using UDFs.

View solution in original post

13 REPLIES 13

Looks not bad.

1) Do you have any exception after Model tryModel = curSession.CreatePart ("Testing1"); ?

2) After call CreatePart ("Testing1"); take a look at the session of Creo. Model is exist but not shown?

3) pfcSession.BaseSession.CreatePart return Part type not Model. Maybe, a trick is there.

 

ps: But in J-Link you can't create features (sketches, extrude and so on)

 

Thanks for the answer!
I managed to create the part using this code.
Now the question is how to extrude there ...
You said that J-Link cannot do this. It seemed to me that way too, while I was dealing with him all this time.
Please tell me can I do this with OBJECT TOOLKIT Java?

Do you know any suitable methods from there?
Best Regards!

Yep, in OTK JAVA is possible.

Take a look at chapter Feature Element Tree in documentation.

 

For J-Link:

1) Template parts with common geometry. Then you can drive a part by changing dimensions and parameters.

2) Build models using UDFs.

Thank you very much for your help and information!

remy
21-Topaz I
(To:VladiSlav)

congrats.

Are you saying that the model was in session but not displayed in the graphics window?

 

about creating feature with JOTK (formerly known as Jlink) there is no direct API according to CS250424.

The resolution consists in using ProToolkit (more powerful). It is the C API.

or call User Defined Features

 

Also find more information from the eportal thanks to your PTC account.

VladiSlav
17-Peridot
(To:remy)

Thank you very much for your congratulations and information!

YaroslavSin
17-Peridot
(To:remy)

Hello, @remy 

I'm not agree with you about JOTK. I think, you are talking about JOTK free = J-Link.

 

I dont have my own expiriens in this using JOTK, but, at least JOTK documentation describes feature creation using Feature Element Tree.

 

And, yep, C TOOLKIT is a most powerful, for now...

remy
21-Topaz I
(To:YaroslavSin)

that's not exactly the subject of this topic but i'll happily address your point.


@YaroslavSin wrote:

I think, you are talking about JOTK free = J-Link.

You are free not to agree and i  understand your point.  The reality is that the Java API offering is broader that your comment entiles.

There has been an official change in the branding and the moniker JOTK for Java Object Toolkit is of use.

 

Now the formely known J-link (the free API) is still in existence and available. It is considered a subset of the JOTK offering and this subset is still free. 

 

About Element Tree, you're indeed right. This enables to create features. This is however far from being a direct API. It requires to fill-in structures and build a hierarchy tree, this is indeed very powerful but one has to admit that this is far from what cane be called a direct API (a one method capability). 

VladiSlav
17-Peridot
(To:remy)

Hello!

 

Can you please tell me how to use Feature Element Tree?
Is there any very simple example?
Or other clues.
At this point, I’ve read the Feature Element Tree chapter and looked at the otkCreateSweep example. But it’s still not very clear.
Thanks in advance!

 

Regards!

remy
21-Topaz I
(To:VladiSlav)

When you search the terms "understanding element tree" in the eportal you will find this https://www.ptc.com/en/support/article?n=CS313525

called "How to create a feature with Creo Toolkit Element Tree"

 

You create a new topic and/or browse the knowledge base.

VladiSlav
17-Peridot
(To:remy)

Thank you so much!

Regards!

VladiSlav
17-Peridot
(To:remy)

Hello!

The manual says:
Id
        Identifier of the element.
        To define the Feature Element Id, use constants described in the module wfcElemIds.
Tell me please.
Where can I find everything find this module? That is, all the IDs for the functions?

Regards

VladiSlav
17-Peridot
(To:remy)

Thanks!
I found
The class is in otk.jar

Top Tags