Reply
Solved! Go to solution

Drawing View Wizard

Hello All,

 

I have three different drawing templates for Sheet Metal, Part and Assembly files.

I need create drafts for these files through VB.Net program.

 

Which API should I use to for the functions present in Drawing View Wizard.

 

Example for selecting Primary View as 'top view', Drawing View as 'Flat Pattern', etc.

 

Please provide your suggestions.

 

Thank you,

Shruthi M.

12 REPLIES
Solution
Solution
Accepted by topic author Developer
‎08-26-2015 04:32 AM

Re: Drawing View Wizard

For creating a drawing view, the following should help you get started:

 

Dim oDocP As SolidEdgePart.PartDocument = oDocs.Open("PartFileName", True)
Dim oDocD As SolidEdgeDraft.DraftDocument= oDocs.Add("SolidEdge.DraftDocument")
       
Dim oSheet As SolidEdgeDraft.Sheet = oDocD.ActiveSheet
Dim oMlink As SolidEdgeDraft.ModelLink = oDoc.ModelLinks.Add("PartFileName")
Dim oView As SolidEdgeDraft.DrawingView = oSheet.DrawingViews.AddPartView(oMlink, igTopView, 1, 0, 0, sePartDesignedView)

If you wish to use one of the templates, the following should be useful:

OpenWithTemplate(Filename As String, Template As String) As Object

 

Re: Drawing View Wizard

Hello Tushar,

 

Thank you for the help.

 

I am able to create Drawing views now based on your suggestion.

 

I need to add X and Y Dimensions to the Drawing View.

Right now I am obtaining the Line collection and from that I found the XMinimum, XMaximum, YMinimum and YMaximum of the entire Drawing.

 

I thought of adding points based upon minimum and mAximum values as coordinates for points and then add dimension to these points.

 

But I dint find any method to add Points on Drawing View. Is this approach correct or is there any method to add X and Y dimension to a drawing View.

 

Please help.

 

Thank you

Re: Drawing View Wizard

Here's a method oView.Range(x1, y1, x2, y2) that gives the size of the view directly in drawing units.

If I understood your question correctly, this will give the minimum and maximum coordinate points for a view.

Hope that was helpful.

Re: Drawing View Wizard

Hi,

 

Please find the attached image.

 

This is how I need to add the dimension to Drawing through VB.Net.

 

Is it possible to add points to add dimensions on Drawing View?

 

 

Re: Drawing View Wizard

What is the API you are using for adding linear dimensions ?

Re: Drawing View Wizard

Though I have a strong dislike for doing someone else's homework, this solution was lying just a topic ahead and is already being disussed by Martin:

 

This is such a frequently asked Q that I must make a blog post out of it. Here are the steps:

1. A drawing view has a DVLines2D collection.

Your view i.e. the part in the Jpeg attached appears to have planar faces on the top and side, so you can loop through the DVLines2d collection to locate the left-most, right-most, top and bottom lines that the view is composed of.

 

Dim oDVLines As DVLines2d
oDVLines = oView.DVLines2d

ForEach oDVLine2d As DVLine2d in oDVLines2d If (oDVLine2d is top-most) ' Use oDVLine.GetEndPoint and StartPoint oDVL1 = oDVLine2d; End If If (oDVLine2d is bottom-most) ' Use oDVLine.GetEndPoint and StartPoint oDVL2 = oDVLine2d; End If
Next

2. Next use the oDVL1 and oDVL2 objects in the AddDimension API to add the

 

Dim oDims As SolidEdgeFrameworkSupport.Dimensions = oSheet.Dimensions
Dim oDim As SolidEdgeFrameworkSupport.Dimension = 

oDims.AddDistanceBetweenObjects(oDVL1, 0, 0, 0, False, oDVL2, 0, 0, 0, False)

This should work though I have not tried out this code.
Alternatively try the simpler AddLength API - it takes just one object.

 

If the zero values for the x, y and z arguments do not work, try replcing them with those obtained from the view extents as below:

 

Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double
oView.Range(x1, y1, x2, y2)

Open the sesdk.chm file from Solid Edge installation folder \Solid Edge ST6\SDK\sesdk.chm

Search for AddDistanceBetweenObjects and read the Parameters description for the points which talks about proximity and not exact points.

Let me know how it goes. Best wishes !

 

 

 

Re: Drawing View Wizard

Hello Tushar,

 

This adds the right dimension. But it is inside the View.

I want the dimensions on the sheet.

 

How do I do this?

 

I have obtained the range of the Drawing View and then tried to add the dimension.

But this dint give the right dimension.

 

Thanks you

Shruthi M.

Re: Drawing View Wizard

You can get some clues from this topic:

http://community.plm.automation.siemens.com/t5/Solid-Edge-Developer-Forum/dimensions-AddDistanceBetw...

 

See the comments from Marin and JB.

 

Re: Drawing View Wizard

[ Edited ]
ForEach oDVLine2d As DVLine2d in oDVLines2d
        If (oDVLine2d is top-most) ' Use oDVLine.GetEndPoint and StartPoint
            oDVL1 = oDVLine2d;
        End If

        If (oDVLine2d is bottom-most) ' Use oDVLine.GetEndPoint and StartPoint
            oDVL2 = oDVLine2d;
        End If

Next

 

Hi Tushar,

 

i am trying to add dimension but i am not able to add. can you please post detailed program for adding dimension.

 

this will help everyone..

 

Thanks in advance,

Bala.