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
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!
Solved! Go to Solution.
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.
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!
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.
Thank you very much for your congratulations and information!
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...
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).
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!
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.
Thank you so much!
Regards!
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
Thanks!
I found
The class is in otk.jar