Quantcast
Channel: PTC Community : Unanswered Discussions - Creo
Viewing all articles
Browse latest Browse all 8685

creating a coordinate system with weblink

$
0
0

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


Viewing all articles
Browse latest Browse all 8685

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>