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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Converting OTK Objects to Pro/Tk

mark_stallard
1-Newbie

Converting OTK Objects to Pro/Tk



Hi Everyone -

I've been working with the new Object Toolkit on Creo 2.0 these
past few weeks. Things have been OK so far, but I'm discovering
something that's much harder than it should be: Converting OTK
objects for use in Pro/Toolkit.

So far, the two standout cases are:

- Converting pfcModelItem_ptr to ProModelitem
- Converting pfcModel_ptr to ProMdl

Getting ProModelitem from pfcModelItem_ptr is especially bad
because ProModelitemInit (and its variants) require a ProMdl
argument. I can't find a pfcModelItem_ptr method to get the
parent pfcModel_ptr.

I think I see a path to convert pfcModel_ptr to ProMdl, but
it will probably be more complicated than I like.

Did I miss something in the OTK documentation?

If I can't get a reasonable solution to these problems, then
I'll won't be using Object Toolkit very much this year.

|+| M a r k |+|

Mark Stallard
Business Application Services
Global Business Services Information Technology
Raytheon Company




(business)
339-645-6423
(cell)
617-331-5443



-



235 Presidential Way
Woburn, MA 01801-1060
www.raytheon.com

This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.






This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3
FV
17-Peridot
17-Peridot
(To:mark_stallard)

Hi all,


Mark,


I think the trick is to get a converted pointer to ProModelitem.


Try this:



pfcModel_ptr pMdl = Session->GetCurrentModel();


if (pMdl != NULL)


{


const ProSolid solid = (ProSolid) wfcGetHandleFromObject( pfcObject::cast(pMdl));


}


pfcModelitem_ptr pMi;


....


const ProModelitem *p_mi = (ProModelitem*) wfcGetHandleFromObject( pfcObject::cast(pMi) );


Feliks.



In Reply to Mark Stallard:




Hi Everyone -

I've been working with the new Object Toolkit on Creo 2.0 these
past few weeks. Things have been OK so far, but I'm discovering
something that's much harder than it should be: Converting OTK
objects for use in Pro/Toolkit.

So far, the two standout cases are:

- Converting pfcModelItem_ptr to ProModelitem
- Converting pfcModel_ptr to ProMdl

Getting ProModelitem from pfcModelItem_ptr is especially bad
because ProModelitemInit (and its variants) require a ProMdl
argument. I can't find a pfcModelItem_ptr method to get the
parent pfcModel_ptr.

I think I see a path to convert pfcModel_ptr to ProMdl, but
it will probably be more complicated than I like.

Did I miss something in the OTK documentation?

If I can't get a reasonable solution to these problems, then
I'll won't be using Object Toolkit very much this year.

|+| M a r k |+|

Mark Stallard
Business Application Services
Global Business Services Information Technology
Raytheon Company




(business)
339-645-6423
(cell)
617-331-5443



-



235 Presidential Way
Woburn, MA 01801-1060
www.raytheon.com

This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.






Feliks -

Thank you for your reply to this.

> pfcModel_ptr pMdl = Session->GetCurrentModel();

This assumes that the current model will not change after I obtain the
pfcModelitem_ptr. I would prefer to use the pfcModelitem_ptr to obtain
its parent pfcModelitem_ptr. If I can't do that, then I'll have to
carry some additional overhead, such as storing both pfcModel_ptr and
pfcModelitem_ptr, or performing the Pro/Toolkit conversion immediately
whenever I get a pfcModelitem_ptr.

Frankly, the best thing PTC could do here is to provide us with utilities
and/or sample code to perform these conversions. It's unrealistic to
expect OTK to immediately replace Pro/Toolkit - think of how long it
took to replace Pro/Develop.

For now, I'll probably need to write my own conversion utilities.

Thanks again for your reply.

|+| M a r k |+|

Mark Stallard
Business Application Services
Global Business Services Information Technology
Raytheon Company




(business)
339-645-6423
(cell)
617-331-5443



-



235 Presidential Way
Woburn, MA 01801-1060
www.raytheon.com

This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.









I think this is a topic of concern that you should bring up during the face-to-face meetings in June.

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01CF6B9A.43DCC070]
Announcements


Top Tags