• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. How do I copy line from component assembly_top layer to...

Stats

  • State Verified Answer
  • Replies 4
  • Subscribers 159
  • Views 6856
  • Members are here 0
More Content

How do I copy line from component assembly_top layer to another layer?

ryamashita
ryamashita over 2 years ago

I am writing some Skill code to copy the RefDes and lines from all of the symbols in a .brd file to another layer.  The code works to copy the RefDes but it doesn't work to copy the lines.  I am able to convert the lines to a polygon but that isn't what I want, I want to keep the lines as lines.  Below is the code that I wrote.  Note I have comments around the code that doesn't work and also the alternate code that seems to work but isn't what I want.  Can anyone help me to figure out what commands I need to copy the lines to another layer?  

(defun temp ()
; disable the Fixed property testing
axlDBIgnoreFixed(t)

; Get list of all components in design
symList=axlDBGetDesign()->symbols

; Go through all the symbols in symList
foreach(cursymbol symList
symchildren=cursymbol->children
; Get a list of all of the children properties of the symbol
symchildren=cursymbol->children
foreach(curChild symchildren
when(curChild->objType=="text" && curChild->layer=="REF DES/ASSEMBLY_TOP"
; Create a copy of the text
copiedtext=axlCopyObject(curChild ?angle 0)
; Move copied text to the "MANUFACTURING/DNI Components Top" layer
axlChangeLayer(copiedtext "MANUFACTURING/DNI Components Top")
)
when(curChild->objType=="path" && curChild->layer=="PACKAGE GEOMETRY/ASSEMBLY_TOP"
; ******** Code that doesn't work **********
; Create a copy of the text
copiedline=axlCopyObject(curChild ?angle 0)
; Move copied line to the "MANUFACTURING/DNI Components Top" layer
axlChangeLayer(copiedline "MANUFACTURING/DNI Components Top")
; ******** Code that doesn't work **********

; ******** Alternate code - Works but not what I want **********
; Create r_path
tempPath=axlDB2Path(curChild)
; Create polygon from r_path
tempPoly=car(axlPolyFromDB(tempPath))
; Create shape from the polygon
axlDBCreateShape(tempPoly, t, "MANUFACTURING/DNI Components Top")
; ******** End Alternate code - Works but not what I want **********
)
)
)
; Reenable the Fixed property testing
axlDBIgnoreFixed(nil)
)

  • Sign in to reply
  • Cancel
  • SandeepVarrier
    0 SandeepVarrier over 2 years ago

    Copy and rotate an object about its origin 0 degrees
    r = axlCopyObject(dbid, ?angle 0)

    where ldbid = list of database objects
    dbid = one database object

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ryamashita
    0 ryamashita over 2 years ago in reply to SandeepVarrier

    Thanks for the reply, it made me go back and double check what was happening on my design.  In my code that I labeled as doesn't work I had used axlCopyObject and thought it wasn't working because I didn't see the lines show up on the right layer.  After rerunning my code I checked and it seems like the axlCopyObject command did work but the problem is that the axlChangeLayer command didn't work.  I use the same sequence, axlCopyObject and then axlChangeLayer for the refdes text and that works fine but I don't know why it doesn't seem to work for the lines.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ryamashita
    0 ryamashita over 2 years ago in reply to ryamashita

    In the algroskill.pdf document I found under the description of axlChangeLayer a reference to using axlDebug(t) to turn on additional messages which then gave me the message "(SPMHGE-522): Changing line to a different class is not supported." when I tried to use the axlChangeLayer command on Lines.  Apparently you can change text to a different class but not lines.  This limitation seems odd because using the GUI command "Edit\Change" you are allowed to change a line from one layer to another layer in a different class.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • DavidJHutchins
    +1 DavidJHutchins over 2 years ago

    replace the following:

    axlDBCreateShape(tempPoly, t, "MANUFACTURING/DNI Components Top")

    with:

    axlDBCreatePath(tempPath "MANUFACTURING/DNI Components Top" )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information