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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

insert a nc-udf

robert.haider
1-Newbie

insert a nc-udf

Hi,

i'm trying to insert a udf with a manufacturing feature to a mfg assembly with toolkit

the udf needs two csys, one datumplane and one datum-axis. All references are defined in toolkit with no user selection. i have the right features from the assembly, but if i want to create the udf, all references to the mfg assembly are lost.

If i insert the udf manualy everything works fine.

Has somebody experience or an idea where the problem could be?

thanks robert


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.
5 REPLIES 5
FV
17-Peridot
17-Peridot
(To:robert.haider)

Hi all,

Robert, more likely ProAsmcomppath for your references (ProSelection) is missing or your selection object refers to features instead of ProGeomitem(s). When you are dealing with manufacturing assemblies usually someone would get an assembly from manufacturing model which is your current one. Then you would get feature(s) in question from asm model. Then you would get ProGeomitem from features and construct ProSelection, do not forget to use ProAsmcomppath and do not pass NULL pointer instead.Check ProUdfreferenceAllocprompt and external flag arguments those guys areoften playing games.

HIH.

Feliks.

In Reply to Robert Haider:

Hi,

i'm trying to insert a udf with a manufacturing feature to a mfg assembly with toolkit

the udf needs two csys, one datumplane and one datum-axis. All references are defined in toolkit with no user selection. i have the right features from the assembly, but if i want to create the udf, all references to the mfg assembly are lost.

If i insert the udf manualy everything works fine.

Has somebody experience or an idea where the problem could be?

thanks robert

Hi Feliks,

thank you for the hint with the assembly-path, this was the reason why the references were not found.

Now the UDF finds all Information, only the Operation-info is lost.

I think that I will try FeatureCreation with ElementTrees. Maybe it works better than the udfs.

robert

Hello Mr. Veysman,


Do you have any helpful information inserting a udmf into a manufacturing assembly using VB API or Web.Link? I believe I have correctly selected the features from the different models in the assembly, but you are saying that features are not what I should be getting handles on? And I am having trouble understanding the idea of "ProGeomitems." What would those relate to in the API Library?


I am having similar problems mentioned by Mr. Haider. The selection stings point to the correct references, but the references that came from the reference part are lost when I try to place the udf into the workpiece part.


Any help is appreciated.


Thank you,


Corey




In Reply to Feliks Veysman:



Hi all,


Robert, more likely ProAsmcomppath for your references (ProSelection) is missing or your selection object refers to features instead of ProGeomitem(s). When you are dealing with manufacturing assemblies usually someone would get an assembly from manufacturing model which is your current one. Then you would get feature(s) in question from asm model. Then you would get ProGeomitem from features and construct ProSelection, do not forget to use ProAsmcomppath and do not pass NULL pointer instead.Check ProUdfreferenceAllocprompt and external flag arguments those guys areoften playing games.


HIH.


Feliks.

In Reply to Robert Haider:



Hi,


i'm trying to insert a udf with a manufacturing feature to a mfg assembly with toolkit


the udf needs two csys, one datumplane and one datum-axis. All references are defined in toolkit with no user selection. i have the right features from the assembly, but if i want to create the udf, all references to the mfg assembly are lost.



If i insert the udf manualy everything works fine.


Has somebody experience or an idea where the problem could be?



thanks robert



FV
17-Peridot
17-Peridot
(To:robert.haider)

Hi all,


Corey,



- ProGeomitem in Web/Link lingo is a geometry modelitem ( surface, edge, curve, datum plane and so on). For explanation of ProGeomitem, ProFeature and ProModelitem please take a look at Pro/Toolkit user guide.


Without seeing the code it is hard to guess what is not working or why...


The common sense advice is to make the most simplistic UDF containing minimum references and no dimensions, for example, the datum point created by intersecting datum axis and datum plane. Set config.pro option show_selected_item_id to yes. Make a recipient part and in Pro/E session interactively select datum plane and datum axis, status bar selection filter should be changed from 'smart' to 'datums', write down selected entities' ids. Initiate modelitems by id, build selection strings, test udf insertion code. Then go to the next step which is building programmatic selection of modelitems from the selected feature, to do so set the selection filter to 'features', select features, write down ids, initiate modelitem by id, write code to find feature dependent modelitems (solid geometry or datum geometry), resulting ids should match ids from the interactive selection. When this portion of code is working initiate feature modelitemes by feature name (this is known) and select feature geometry using previously written code. When this is working proceed to inserting udf into top level assembly. This part of code will deal with building ProAsmcomppath. When this code is working continue testing insertion UDF into the first level component and into the second level component. When the code is working in regular assembly go to a manufacturing assembly. After this make another UDF which has more challenging set of references and so on...



I am having similar problems mentioned by Mr. Haider. The selection stings point to the correct references, but the references that came from the reference part are lost when I try to place the udf into the workpiece part.


Any help is appreciated.


Thank you,


Corey




In Reply to Feliks Veysman:



Hi all,


Robert, more likely ProAsmcomppath for your references (ProSelection) is missing or your selection object refers to features instead of ProGeomitem(s). When you are dealing with manufacturing assemblies usually someone would get an assembly from manufacturing model which is your current one. Then you would get feature(s) in question from asm model. Then you would get ProGeomitem from features and construct ProSelection, do not forget to use ProAsmcomppath and do not pass NULL pointer instead.Check ProUdfreferenceAllocprompt and external flag arguments those guys areoften playing games.


HIH.


Feliks.

In Reply to Robert Haider:



Hi,


i'm trying to insert a udf with a manufacturing feature to a mfg assembly with toolkit


the udf needs two csys, one datumplane and one datum-axis. All references are defined in toolkit with no user selection. i have the right features from the assembly, but if i want to create the udf, all references to the mfg assembly are lost.



If i insert the udf manualy everything works fine.


Has somebody experience or an idea where the problem could be?



thanks robert




Thanks for the reply,


I just found the problem yesterday. Ihad triedto grab the reference items as both an IpfcFeature or IpfcModelItem. What ended up working was specifying what type of model item each reference was, i.e. IpfcAxis, IpfcSurface, etc. I used GetItemByName on the IpfcModelItemOwner that existed in the manufacturing assembly and specified the enumerated model item type, Then, to make the selection,I had to specify the component path in the assembly as you stated previously in this thread.


Thanks for the help.

Top Tags