Skip to main content
1-Visitor
June 6, 2017
Question

place a udf by web.link / jlink in a part using external References

  • June 6, 2017
  • 1 reply
  • 1490 views

CODE:

var assembly

function udfInPart()
{
  session = pfcGetProESession ();
  assembly     = session.CurrentModel;
var part         = session.GetModel ("60606060-000.PRT", pfcCreate("pfcModelType").MDL_PART);
// =========================================================================================================
var ids = pfcCreate ("intseq");
   ids.Append( 0 );
  var path = pfcCreate ("MpfcAssembly").CreateComponentPath ( assembly , ids );
// =========================================================================================================
var items = assembly.GetItemByName( pfcCreate("pfcModelItemType").ITEM_COORD_SYS, 'ACS_TOOL' );
// =========================================================================================================
var sysRef = pfcCreate("MpfcSelect").CreateModelItemSelection (items, null);
// =========================================================================================================
var Ref1 = pfcCreate("pfcUDFReference").Create("ACS_TOOL", sysRef);
       Ref1.IsExternal = true;
// =========================================================================================================
var Refs = pfcCreate("pfcUDFReferences");
       Refs.Append (Ref1);
// =========================================================================================================
var UDFInsts = pfcCreate("pfcUDFCustomCreateInstructions").Create("test_udf");
       UDFInsts.References = Refs;
var NewUDF = crvSet.CreateUDFGroup(UDFInsts);
}

1 reply

mfenske1-VisitorAuthor
1-Visitor
June 6, 2017

Sorry, first post was too fast

Hello PTC communtiy,

i need help according an issue using weblink/jlink for placing an udf in an part (with references from the assembly), which is an member of an assembly (root).

Everything works fine so far, i can place different udf's in the part using weblink.

But as soon as i want to edit the feature (after placing) i get an prompt that Pro/E is missing the external references.

How can i solve this issue? I have tried different things, but i still get the same failure all the time.

When i place the udf's direct in the assembly, everythings just fine and there is no "external references missing" prompt.

I have attatched a picture for you, to expalin the modell structure.

The weblink code is shown above

Thank you very much for any advices in advance.

Berst regards.

Markus

weblink.jpg

24-Ruby III
June 6, 2017

Hi,

if your company has active Global Support at PTC, then I suggest you to open Case at PTC Support.

MH