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

How to set correct symbol height using JLink or Toolkit?

Highlighted
Newbie

How to set correct symbol height using JLink or Toolkit?

~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

1 REPLY 1
Highlighted

How to set correct symbol height using JLink or Toolkit?

Hi Mark
Reading the documentation the method instrs.SetScaledHeight(d) should do what you need.

/Bjarne
Announcements