How to programmatically align Different views(Front,left,right etc.) in Drawing?


Hello ,

I am trying to generate drawings using Solidedge programmign interface.I can successfully generate particular views like front view,right view,left etc.

But these views moves here n there irresepect to each other.Through UI we can align them by right clicking on a view and then saying Create Alignment.

But through program we need to align them by DrawingViews.Align()

BUt its not working....I am also sending the code....

Please help i have searched for this everywhere but couldnt found anything ...........I hope you people can help me in this issue.....

Even SDK doesnt have proper explanation for the method...I am using VB for programming....Dont worry its similar to VB.Net



Public objApp As SolidEdgeFramework.Application

Dim objSourceDoc As SolidEdgeDraft.DraftDocument

    On Error Resume Next

    Set objApp = GetObject(, "SolidEdge.Application")

    If Err Then


        Set objApp = CreateObject("SolidEdge.Application")

        objApp.Visible = True



    End If

    Set objSourceDoc = objApp.Documents.Add("SolidEdge.DraftDocument")



    Dim objDrawingViews As SolidEdgeDraft.DrawingViews


    Dim objDrawingView1 As SolidEdgeDraft.DrawingView

    Dim objDrawingView2 As SolidEdgeDraft.DrawingView


    Dim objModelLink As SolidEdgeDraft.ModelLink


    Set objSourceDoc = objApp.ActiveDocument


    Set objModelLink = objSourceDoc.ModelLinks.Add("C:\ESSILProject\Try\Assembly\Final.asm")


    Set objDrawingViews = objSourceDoc.Sheets(1).DrawingViews


    Set objDrawingView1 = objDrawingViews.AddAssemblyView(objSourceDoc.ModelLinks(1), igFrontView, 1, 0.25, 0.25, seAssemblyDesignedView)


    Set objDrawingView2 = objDrawingViews.AddAssemblyView(objSourceDoc.ModelLinks(1), igRightView, 1, 0.5, 0.5, seAssemblyDesignedView)




    Dim sel As SolidEdgeFramework.SelectSet

    Set sel = objApp.ActiveSelectSet


    Call sel.RemoveAll


    Call sel.Add(objSourceDoc.Sheets(1).DrawingViews(1))

    Call sel.Add(objSourceDoc.Sheets(1).DrawingViews(2))




If you want test this im sending the Final.asm file else you can use any of your file for this.......................


Posted by: Gaurav patil
Post date: 9/8/2008 10:19:45 PM


RE: How to programmatically align Different views(Front,left,right etc.) in Drawing?

Does anyone out there know the answer to this? I've been trying to align drawing views for a while now but to no avail.



Posted by: T Kin
Post date: 10/9/2008 2:36:55 AM

RE: How to programmatically align Different views(Front,left,right etc.) in Drawing?

Instead of trying to align the DrawingViews I have used the AddByFold method to create aligned views...


objDrawingView2 = objDrawingViews.AddByFold( _

objDrawingView, _

FoldTypeConstants.igFoldRight, _

dblX, _



Posted by: Scott Hadley
Post date: 10/29/2008 9:24:28 AM