creating a coordinate system with weblink
Hi there,
is there a way to create a coordinate system with weblink?
I tried it with an UDF, but for some reason I have to select its reference everytime. Another disadvantage I see with UDFs is, that I have to administer two different data-sources for one function.
function create_csys_from_udf(reference_name, name_def, trans_x, trans_y, trans_z, rot_x, rot_y, rot_z){
var udf_instructions = pfcCreate ("pfcUDFCustomCreateInstructions").Create ("wl_add_cs_w_dtms");
udf_instructions.DimDisplayType = pfcCreate ("pfcUDFDimensionDisplayType").UDFDISPLAY_BLANK;
var origin_of_csys = CurModel.GetItemByName(pfcCreate("pfcModelItemType").ITEM_COORD_SYS, reference_name);
var selected_origin_of_csys = pfcCreate("MpfcSelect").CreateModelItemSelection(origin_of_csys, void null);
var origin_ref = pfcCreate("pfcUDFReference").Create("Ursprung", selected_origin_of_csys );
var udf_references = pfcCreate("pfcUDFReferences");
udf_references.Append(origin_ref);
udf_instructions.References = udf_references; --> this is ignored by creo
// move and rotate csys
var udf_dimensions = pfcCreate ("pfcUDFVariantValues");
var translation_x = pfcCreate ("pfcUDFVariantDimension").Create ("trans_x", trans_x);
udf_dimensions.Append(translation_x);
udf_instructions.VariantValues = udf_dimensions;
var udf_group = CurModel.CreateUDFGroup(udf_instructions);
// rename udf-components
var udf_csys = CurModel.GetItemByName(pfcCreate("pfcModelItemType").ITEM_COORD_SYS, "CS_UDF_TEMP");
udf_csys.SetName("CS_" + name_def);
return (udf_group);
}
Any idea?
Cheers
Mat
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.

