Quantcast
Channel: Cadence PCB Skill Forum
Viewing all articles
Browse latest Browse all 2154

Getting lines on Assembly Top for a symbol

$
0
0

Hello friends,

I’m in need of assistance. I’m new to Skill, but not to programming, and I’ve been reading the manual. Unfortunately the hierarchy of objects in Allegro is still clear as mud to me.

What I’m trying to do:

automatically size, and place, the RefDes in the center of the “box” on Assembly top. By “box” I mean the set of lines creating the mechanical outline of the physical component, not synonymous with the bounding box of the symbol. It is important to get the collection of lines that compose this box, so the RefDes text block can be set appropriately to fit within the lines. For instance I want to size the RefDes appropriately so it will fit inside an 0402 resistor. 

This is ultimately to automate assembly drawing creation, within the context of a BRD. I’ve noted other scripts that place the RefDes in the symbol center, but I haven’t seen any that find the bounding box of lines on assembly top, to size the RefDes appropriately. So I could use a little direction. Here’s what I’ve got so far: I'm able to grab all the symbols, print their names, and list their paths, but thats as far as I've got. I'm trying to figure out how to extract the line width and the line endpoints. 

    allSymbols = axlDBGetDesign()->symdefs
    foreach(symbol allSymbols 
        children = setof(children symbol->children index(children->layer "PACKAGE GEOMETRY/ASSEMBLY_TOP") )
        foreach( child children
            printf("\t\t")
            printf(child->objType)
            printf("\n")

            if( child->objType == "path" && child->nSegs != nil then
                printf("\t\t\t#segments in path: ")
                printf("%d" child->nSegs)
                printf("\n")
            )
        )
    )

I haven’t been able to grab any useful properties from each path however. The only thing I’ve been able to extract is the # of segments. All other methods I’ve tried to run extracting info from each path has been fruitless.

For instance trying to list the segments doesnt work:

   if( child->objType == "path" && axlPathGetPathSegs( child ) != nil then
                printf("\t\t\tSegments: %s\n" axlPathGetPathSegs( child) )
            )
I'm not sure if I don't have the proper context for these paths, or I'm using the wron methods, or what. Any assistance would be very much appreciated!

Viewing all articles
Browse latest Browse all 2154


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>