I am working on one of the module where I need to obtain bounding box for some of the components of PCB using skill script.
I have already written skill script to obtain bounding box for selected components.
I am using "axlDBGetExtents" function for this.
However, I am facing one problem with this method.
Bounding boxes obtained using this function are larger than what I need.
For my purpose, I need bounding box prefereably (or I would say ideally) of the size of top surface of the component.
My Current Method:
I have used "t" as second argument for axlDBGetExtents(id t) function.
According to documentation, by using "t" as a second argument, bounding box only for visible parts of component is selected.
I am controlling visibility by using "Display->Color/Visibility" option.
I am choosing to disable all options except "Package Geometry -> Assembly_Top & Display_Top".
Please let me know if I am doing something wrong here as I have started using this software only a month ago.
Any suggestions that would help me in resolving this problem are welcome.
I'm using specific layers DFA_BOUND_xxx or PLACE_BOUND_xxx and bBox property.
As I do it:
;; Get object boundary box.; First trying get Dfa_Bound_Top(Bottom); if Dfa not present trying Place_Bound_Top(Bottom); if Place not present get bBox property.;defun( getObjectBBox (object) let( ( objectChildren child dfaLayer placeLayer result) if(object->isMirrored then dfaLayer = "PACKAGE GEOMETRY/DFA_BOUND_BOTTOM" placeLayer = "PACKAGE GEOMETRY/PLACE_BOUND_BOTTOM" else dfaLayer = "PACKAGE GEOMETRY/DFA_BOUND_TOP" placeLayer = "PACKAGE GEOMETRY/PLACE_BOUND_TOP" ) objectChildren = object->children ; only Symbols have objectChildren if(objectChildren then ; find Dfa_Bound_ shape foreach( child objectChildren if((child->objType == "shape" && child->layer == dfaLayer) then result = child->bBox ) ) ; find Place_Bound_ shape if(!result then foreach( child objectChildren if((child->objType == "shape" && child->layer == placeLayer) then result = child->bBox ) ) ) ) if(!result then result = object->bBox) result ) ; let) ; defun
In reply to Silver John:
Thanks very much for your reply.
Your method gave me the required size bounding boxes for components.