Reply
Solved! Go to solution

Adding surface finish symbols in a draft

Hi all,

 

I'm trying to add new surface finish symbols to a draft in a desired X,Y point but i can't get it.

 

The goal is to create the general surface finish symbols in the top right corner of the draft sheet.

 

I've tried to create it the same form that ballon are added.

 

I'm programming in vb 2010 for ST6.

 

Could you help me, please?

Héctor Pelayo Izquierdo
Engineering Department, JAE Ingeniería y Desarrollos, S.L.
Solid Edge ST9 MP5 | NX 9
Development: VB.NET
2 REPLIES
Solution
Solution
Accepted by topic author Hector
‎08-26-2015 04:32 AM

Re: Adding surface finish symbols in a draft

I am not sure, if the following code resolves your problem as it creates the surface symbol on a specific point on the drawing sheet. In practise, you would normally attach it to some geometry in a drawing view.

'----------------------------------------------------------------------
' DFT: Create a SurfaceFinishSymbol on a specific x,y-position of the
'      Drawing sheet. In practice you will probably create the symbol 
'      attached to some geometry in a view!!
'----------------------------------------------------------------------
Const x = 0.5
Const y = 0.3
Dim objDoc As DraftDocument = objApp.ActiveDocument
Dim objSheet As Sheet = objDoc.ActiveSheet
' Create a point at a specific position in order to attach the symbol to it
Dim objPnt As Point2d = objSheet.Points2d.Add(x, y)
Dim objSFSymbols As SurfaceFinishSymbols = objSheet.SurfaceFinishSymbols
Dim objSFSymbol As SurfaceFinishSymbol = objSFSymbols.AddByTerminator(objPnt, 0, 0, 0, True)
If objSFSymbol IsNot Nothing Then
  objSFSymbol.BreakLine = True
  objSFSymbol.AddVertex(x + 0.01, y + 0.01, 0)
  objSFSymbol.SurfaceFinishSymbol = DimSurfTextureSymTypeConstants.igDimSurfaceFinishBasic
End If

 

Re: Adding surface finish symbols in a draft

Hi, Martin

 

Thanks for your answer.

 

I'll try your solution as soon as possible but it look perfect.

 

What I really want to do is to locate this symbols in the upper right corner of the sheet not connected to any geometry, just the symbol, without breakline or so. Your idea of create a point and then attach the simbol to that point it's good.

 

Actually I'm doing it by manually creating blocks with the desired symbols and then, programatically, placing them in the correct position.

 

Thank again for your answer.

 

 

 

 

Héctor Pelayo Izquierdo
Engineering Department, JAE Ingeniería y Desarrollos, S.L.
Solid Edge ST9 MP5 | NX 9
Development: VB.NET