AnsweredAssumed Answered

How to add graphics object on user draft layer

Question asked by joseph.spang1 on Aug 20, 2013
Latest reply on Aug 26, 2013 by Satoru

Hi All,

 

I'm trying to put crossline on the user layer called Unplaced Graphics Assembly in cell editor.

In fact I'm able to put crossline on fabrication layer using this script:

 

Sub Document_PutUserLayerGfx()
Dim docObj,resultMess,geomObj,pntsArr,numPoints,newObj,layerObj
Dim fabGfxObj,gfxObj

' collect document object

Set docObj = GetLicensedDoc(app)
If (docObj Is Nothing) Then Exit Sub

'fill the Line with points

ReDim pntsArr(2,8)
  numPoints = 2
  pntsArr(0,0) = -5.0   :pntsArr(1,0) = -5.0   :pntsArr(2,0) =    0.0
  pntsArr(0,1) = 5.0 :pntsArr(1,1) = 5.0   :pntsArr(2,1) =    0.0
set fabGfxObj = docObj.PutFabricationLayerGfx( epcbFabAssembly, epcbSideTop,0.4,numPoints,pntsArr, False,Nothing,epcbUnitCurrent)

ReDim pntsArr(2,8)
  numPoints = 2
pntsArr(0,0) = -5.0 :pntsArr(1,0) = 5.0 :pntsArr(2,0) =    0.0
pntsArr(0,1) = 5.0 :pntsArr(1,1) = -5.0 :pntsArr(2,1) =  0.0
set fabGfxObj = docObj.PutFabricationLayerGfx( epcbFabAssembly, epcbSideTop,0.4,numPoints,pntsArr, False,Nothing,epcbUnitCurrent)

If (Err) Then
  Call app.Gui.StatusBarText("An error occured while creating the object: " + vbNewLine + Err.Description,epcbStatusFieldError)
Exit Sub

Else
resultMess = "Fabrication layer element was created"

'select the object and fit it on the board

   fabGfxObj.selected = True
   docObj.ActiveView.SetExtentsToSelection
   fabGfxObj.selected = False

'Update status bar

   Call app.Gui.StatusBarText(resultMess,epcbStatusField1)

End If

End Sub

 

Thanks,

Joseph

Outcomes