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.
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: