Lin's profileHappy life of WEI LinPhotosBlogLists Tools Help

Blog


    7/10/2008

    C# operation in visio drawing-control

    Experience:
    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.
     

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://hippoweilin.spaces.live.com/blog/cns!6A3154985E0391D1!2391.trak
    Weblogs that reference this entry
    • None