Automatic Center Lines

Creator
Creator

Hello everyone

I have a little problem... I'm programing in vb.net,and when insert a drawingview in my draft file I want use the "automatic center lines" in my code  ....

I glad if anyone can show me how to used or where finded ........

Regards.....  

 

14 REPLIES

Re: Automatic Center Lines

Phenom
Phenom

Hello Damon,

Can you post a image of the kind of center lines you want.

 

BR

Re: Automatic Center Lines

Creator
Creator

Hi Tushar,

I'm using this automatic center lines but i want to use this in my code already have the drawingview selected and i'm looking for how put the automatic center lines in vb.net i hope to you can help me ....

 

post3.jpg 

Re: Automatic Center Lines

Creator
Creator
                Select Case dpar_comp1
                    Case "HD001", "hd001"
                        objSections = objDraft.Sections
                        objSection = objSections.WorkingSection
                        objSection = objSections.BackgroundSection
                        objSheets = objDraft.Sheets
                        objSheet = objSheets.AddSheet("HD001", SheetSectionTypeConstants.igWorkingSection)
                        objSheet.Activate()
                        objModelLinks = objDraft.ModelLinks
                        objModelLink = objModelLinks.Add(pathcom & "\" & par_comp1)
                        objDrawingViews = objSheet.DrawingViews
                        'insert drawing views
                        objDrawingView = objDrawingViews.AddPartView(objModelLink, "4", 1, 0.12, 0.1, "0")
                        objDrawingView = objDrawingViews.AddPartView(objModelLink, "2", 1, 0.25, 0.1, "0")
                        objDrawingView = objDrawingViews.AddPartView(objModelLink, "1", 1, 0.12, 0.2, "0")

                        objApplication.StartCommand(SolidEdgeFramework.SolidEdgeCommandConstants.seDraftSelectCommand)

 This is part of my code  i have inserted the drawingviews from my draw and the drawingview selected....

Regards ...

Re: Automatic Center Lines

Phenom
Phenom

This worked for me:

 

Private Sub Button25_Click(sender As System.Object, e As System.EventArgs) Handles Button25.Click

  Dim oApp As SolidEdgeFramework.Application = Marshal.GetActiveObject("SolidEdge.Application")

  Dim oDoc As SolidEdgeDraft.DraftDocument = oApp.ActiveDocument

  Dim oSheet As SolidEdgeDraft.Sheet = oDoc.ActiveSheet
  Dim oViews As DrawingViews = oSheet.DrawingViews

  For Each oView As DrawingView In oSheet.DrawingViews
    oView.RetrieveCenterLinesCenterMarks()
  Next
End Sub

In your case, use:

 

objDrawingView.RetrieveCenterLinesCenterMarks()

Additionally, there is a heap of optional arguments to this function, mostly booleans.

 

Hope that was useful.

 

BR,

Tushar Suradkar

http://surfandcode.blogspot.in

www.cadvertex.com

 

Re: Automatic Center Lines

Creator
Creator

Thanks, Tushar

That exactly than i want i making testings whit the diferents booleans and yes, show me the automatic centerlines...the center marks in the circles not show me yet...but maybe i have some wrong in my code....Thanks

 

Re: Automatic Center Lines

Creator
Creator

Hi Thusar Im trying whit "Retrievecenterlinescentermarks" and only put the centerlines........

The centermarks are missings Do you know what happend

Regards

Case "HD001", "hd001"
                        objSections = objDraft.Sections
                        objSection = objSections.WorkingSection
                        objSection = objSections.BackgroundSection
                        objSheets = objDraft.Sheets
                        objSheet = objSheets.AddSheet("HD001", SheetSectionTypeConstants.igWorkingSection)
                        objSheet.Activate()
                        objModelLinks = objDraft.ModelLinks
                        objModelLink = objModelLinks.Add(pathcom & "\" & par_comp1)
                        objDrawingViews = objSheet.DrawingViews
                        'insert drawing views
                        objDrawingView = objDrawingViews.AddPartView(objModelLink, "4", 1, 0.12, 0.1, "0")
                        '****************
                        objDrawingView.RetrieveCenterLinesCenterMarks(IsRetrieve:=True, GetCenterMarkToCircle:=True)

 

Re: Automatic Center Lines

Phenom
Phenom

I created views for Anchor.par from the Training folder at a scale of 1:2 and the following arguments created both centerlines and centermarks for me:

 

oView.RetrieveCenterLinesCenterMarks(, , , , , , , , True, , , , False, False, 1.0, 50.0, 1.0, 50.0)

 

The demon is in the details Smiley Wink

 

Re: Automatic Center Lines

Creator
Creator

Thank's Tushar

I had to make a cycle to put the centermarks bycouse the "retrievecenterlinescentermarks"

only put the centerlines, i could not find the centermarks but with the cycle fund the solution to my problem..Thansk's Tushar

Re: Automatic Center Lines

Phenom
Phenom

What are the arguments ?