Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
~hi all,
I am having trouble getting the correct transformation for sizing a drawing symbol programmatically using JLink. I'll try and explaing what's happening...
I have a drawing with a 1:1 scale view on it. I am prompting the user for a symbol height to apply to a libraried symbol before retrieving it and placing it on the drawing. The symbol's as-created (default) size is 0.50" height x 3.00" width. But let's say the user wants to place the symbol with a 1.00" height? I know I have to transform the real height to a screen height but not sure what that process is.
I am using:
Drawing drw;
//retrieve the drawing object
symDef = drw.RetrieveSymbolDefinition ("mysymbol", null, null, null);
DetailSymbolInstInstructions instrs = pfcDetail.DetailSymbolInstInstructions_Create (symDef);
instrs.SetHeight(d);
drw.CreateDetailItem (instrs);
Obviously (d) in the SetHeight can't be the real 1.00" -- so how do I get the screen size?
I get close usingdrw.GetSheetTransform(1); and manipulating but never exact...
Can anyone shed some light on this for me or point in the right directions?
tia
_mark