Reply

Add Center mark

Hi, i need to add center mark for all circular entities of particular drawing view. see below code, objsheet=objdraft.activesheet objviews=objsheet.drawingviews 'i need to add center mark for drawing view 1 objview=objviews.item(1) objcircles=objview.dvcircles circlecount=circles.item(circles.count) objcentermarks=objsheet.centermarks for i=1 to circlecount call objview.getcenterpoint(x:=a,y:=b) objcircle=objcircles.item(i) call objcircle.getcenterpoint(x:=c,y:=d) 'view scale scale=objview.scale e=a+c*scale f=b+d*scale objcentermark=objcentermarks.addbycenter(CenterObject:=objCircle, x:=e, y:=f, z:=0, KeyPoint:=True) next ' if i run this code, it will add all the axis on outside the template. not on exact center of circular entity (e,f). ' anybody can help me for this issue.
5 REPLIES

Re: Add Center mark

Hi,

the DrawingView object has no method "getcenterpoint()".

To transform the circle centeter points in the view just use the ViewToSheet() method.

To get the circles count just use the Count property of the objcircles variable.

 

An other way to get all centermarks of the circles in the  view is to call "RetrieveCenterLinesCenterMarks()".

 

regards

JB
VS2015, SE ST10

Re: Add Center mark

Hi, To retrieving center mark in drawing view i used RetrieveCenterLinesCenterMarks but in vb it is showing "Expression does not produce value. anybody can me explain what i missed in Code. Below i mentioned the code Imports System.Runtime.InteropServices Imports SolidEdgeDraft Module Module1 Sub Main() Dim app As SolidEdgeFramework.Application = Nothing Dim dft As SolidEdgeDraft.DraftDocument = Nothing Dim sheet As SolidEdgeDraft.Sheet = Nothing Dim views As SolidEdgeDraft.DrawingViews = Nothing Dim view As SolidEdgeDraft.DrawingView = Nothing Dim centermarks As SolidEdgeFrameworkSupport.CenterMarks app = Marshal.GetActiveObject("solidedge.application") dft = app.ActiveDocument sheet = dft.ActiveSheet views = sheet.DrawingViews view = views.Item(1) centermarks = view.RetrieveCenterLinesCenterMarks(True, "ANSI", False, True, False, True, False, False, True, False, False, False, True, True, 0, 0, 0, 0) End Sub End Module thanks in advance, balaji.l

Re: Add Center mark

Call view.RetrieveCenterLinesCenterMarks(, , , , , , , , True, , , , False, False, , , , ) this code is working fine

Re: Add Center mark

Hi,
see you fond the solution.
Since RetrieveCenterLinesCenterMarks() does not return a value the assignment to centermarks incorrect.

 

centermarks = view.RetrieveCenterLinesCenterMarks(True, "ANSI", False, True, False, True, False, False, True, False, False, False, True, True, 0, 0, 0, 0)

Pls add the next time your code the the "insert code" to your message. It is then more readable Smiley Wink

regards

JB
VS2015, SE ST10

Re: Add Center mark

thanks JB