| Lin's profileHappy life of WEI LinPhotosBlogLists | Help |
|
7/10/2008 C# operation in visio drawing-controlExperience:
1. Page size default present in inch in visio's drawing-control. 2. For compability of coding in different page size presenting mode, need convert logic point to inch or reversly. Microsoft.Office.Interop.Visio.Application.ConvertResult provide it. 3. Get master object should use stencil document's Masters[] interface, don't use get_ItemU because sometimes failed. (Don't know why.) 4. Page size can be modified with in sample code. this.current_page_.PageSheet.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowPage, (short)VisCellIndices.visPageWidth).Formula = "8"; // in inch
this.current_page_.PageSheet.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowPage, (short)VisCellIndices.visPageHeight).Formula = "8"; // in inch
5. Glue action can move shape automatically to the target shape.
6. The source object's connection pointer can be found using visRowConnectionPts in shape's get_CellsSRC method's second parameter, but while it become a target object, its connection pointer just can be found using parameter visRowConnectionPts + 2. (Don't know why.) 7. Sometimes, find the target object's connection pointer firstly just can through parameter visRowConnectionPts + 2. (Don't know why.) 8. Glue with 2 2D shapes directly just can use static mode using connection pointer, but glue 2 2D shape with connector can use static or dynamic mode using connection pointer or section object. (Refer to sample code.) 9. Master can be repeatly dropped on page to generates mutilple shapes. Problems:
1. Layout is still a difficulty in coding with drawing-control. 2. Principle of connection pointer in Shape is still a puzzle to me. A: Connection pointer of master can be defined with ShapeSheet, it's a window in office visio application, Accordingly the first connection pointer also can be defined, it can be referred in code using visRowConnectionPts, and the second referred using visRowConnectionPts + 1, and so on.
TrackbacksThe trackback URL for this entry is: http://hippoweilin.spaces.live.com/blog/cns!6A3154985E0391D1!2391.trak Weblogs that reference this entry
|
|
|