How do I define the units for PinX and PinY when dropping shapes.

N

Nick

I wish to drop shapes onto the document using the Drop method. This requires
PinX and PinY co-ordinates.
The default unit appears to be inches but how can I programatically define
the units of PinX and PinY?
 
S

shashi behari

The Code Librarian in the Visio SDK has a sample called "Shape Drop Master"
which sets the units programmatically, from what i gather this is the part
you need :

cellPinX = droppedShape.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowXFormOut,
(short)VisCellIndices.visXFormPinX);

to get a ref to the PinX Cell

and...

cellPinX.set_Result(units, pinX);

to edit the cell.

there is also this method which converts units:

newPinX = visioApplication.ConvertResult(pinX, units, VisUnitCodes.visInches);

im guessing this will allow you to use whichever unit code you want in
parameter 3

hope this helps..
 
N

Nick

Thanks sashi, this was excatly the information I needed (and such a quick
reply too)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top