Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
SKILL
:
poly2path.il
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
(procedure (polytopath) (setq win (hiGetCurrentWindow)) (setq cv (deGetCellView)) (setq db (car (geGetSelectedSet cv))) (setq test 0) (if (equal (getSGq db objType) "rect") then (setq mo (getSGq db layer)) (setq lo (leftEdge db)) (setq ro (rightEdge db)) (setq bo (bottomEdge db)) (setq to (topEdge db)) (setq cn1 (difference to bo)) (setq cn2 (difference ro lo)) (if (greaterp cn1 cn2) then (setq co (quotient (plus lo ro) 2)) (setq width (abs (difference lo ro))) (setq list1 (range co bo)) (setq list2 (range co to)) (setq full (list list1 list2)) (setq test (dbCreatePath cv mo full width)) (geDeleteSelSet win)) (if (geqp cn2 cn1) then (setq co1 (quotient (plus bo to) 2)) (setq widthl1 (abs (difference to bo))) (setq listl1 (range lo co1)) (setq listl2 (range ro co1)) (setq fulll (list listl1 listl2)) (setq test (dbCreatePath cv mo fulll widthl1)) (geDeleteSelSet win))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq h (list 0 0)) (setq s (getSGq db points)) (setq w (quotient (length s) 2)) (setq p (difference w 1)) (for i 0 (difference (quotient (length s) 2) 1) (setq m (car (nth w s))) (setq n (car (nth p s))) (setq q (car (cdr (nth w s)))) (setq f (car (cdr (nth p s)))) (setq z (quotient (plus m n) 2)) (setq x (quotient (plus q f) 2)) (setq stack (list z x)) (setq h (append h (list stack))) (setq w (plus w 1)) (setq p (difference p 1)) (setq i (plus i 1))) (setq a (cddr h)) (setq wid (abs (difference f q))) (if (nequal wid 0) then (setq id1 (dbCreatePath cv mo a wid)) (setq bboxrec (getSGq db bBox)) (setq bboxpoly (getSGq id1 bBox)) (if (equal bboxrec bboxpoly) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec bboxpoly) then (geDeselectAllFig) (geSelectFig id1) (dbDeleteObject id1))))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq h2 (list 0 0)) (setq s2 (getSGq db points)) (setq w2 (plus (quotient (length s2) 2) 1)) (setq p2 (difference w2 1)) (for i2 0 (difference (quotient (length s2) 2) 2) (setq m2 (car (nth w2 s2))) (setq n2 (car (nth p2 s2))) (setq q2 (car (cdr (nth w2 s2)))) (setq f2 (car (cdr (nth p2 s2)))) (setq z2 (quotient (plus m2 n2) 2)) (setq x2 (quotient (plus q2 f2) 2)) (setq stack2 (list z2 x2)) (setq h2 (append h2 (list stack2))) (setq w2 (plus w2 1)) (setq p2 (difference p2 1)) (setq i2 (plus i2 1))) (setq a2 (cddr h2)) (setq wid2 (abs (difference f2 q2))) (setq firgetp21 (car (nth 0 s2))) (setq firgetw21 (car (nth 1 s2))) (setq firmix1 (quotient (plus firgetp21 firgetw21) 2)) (setq firgetp22 (car (cdr (nth 0 s2)))) (setq firgetw22 (car (cdr (nth 1 s2)))) (setq firmix2 (quotient (plus firgetp22 firgetw22) 2)) (setq mix12 (list firmix1 firmix2)) (setq a2 (append a2 (list mix12))) (if (nequal wid2 0) then (setq id2 (dbCreatePath cv mo a2 wid2)) (setq bboxrec2 (getSGq db bBox)) (setq bboxpoly2 (getSGq id2 bBox)) (if (equal bboxrec2 bboxpoly2) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec2 bboxpoly2) then (geDeselectAllFig) (geSelectFig id2) (dbDeleteObject id2))))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq s3 (getSGq db points)) (setq w3 (difference (length s3) 3)) (setq p3 0) (setq h3 (list 0 0)) (setq ldw3 (difference (length s3) 1)) (setq ldp3 (difference (length s3) 2)) (setq lasgetp31 (car (nth ldp3 s3))) (setq lasgetw31 (car (nth ldw3 s3))) (setq lasmix31 (quotient (plus lasgetp31 lasgetw31) 2)) (setq lasgetp32 (car (cdr (nth ldp3 s3)))) (setq lasgetw32 (car (cdr (nth ldw3 s3)))) (setq lasmix32 (quotient (plus lasgetp32 lasgetw32) 2)) (setq mix312 (list lasmix31 lasmix32)) (setq h3 (append h3 (list mix312))) (for i3 0 (difference (quotient (length s3) 2) 2) (setq m3 (car (nth w3 s3))) (setq n3 (car (nth p3 s3))) (setq q3 (car (cdr (nth w3 s3)))) (setq f3 (car (cdr (nth p3 s3)))) (setq z3 (quotient (plus m3 n3) 2)) (setq x3 (quotient (plus q3 f3) 2)) (setq stack3 (list z3 x3)) (setq h3 (append h3 (list stack3))) (setq w3 (difference w3 1)) (setq p3 (plus p3 1)) (setq i3 (plus i3 1))) (setq a3 (cddr h3)) (setq wid3 (abs (difference n3 m3))) (setq widr (abs (difference f3 q3))) (if (equal wid3 0) then (setq id3 (dbCreatePath cv mo a3 widr))) (if (equal widr 0) then (setq id3 (dbCreatePath cv mo a3 wid3))) (setq bboxrec3 (getSGq db bBox)) (setq bboxpoly3 (getSGq id3 bBox)) (if (equal bboxrec3 bboxpoly3) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec3 bboxpoly3) then (geDeselectAllFig) (geSelectFig id3) (dbDeleteObject id3)))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq s4 (getSGq db points)) (setq pl4 (quotient (length s4) 2)) (setq el4 (quotient pl4 2)) (setq p4 (difference (plus el4 pl4) 1)) (setq w4 (plus el4 pl4)) (setq y4 (difference (quotient (length s4) 2) 1)) (setq t4 0) (setq h4 (list 0 0)) (for i4 0 (difference el4 1) (setq m4 (car (nth w4 s4))) (setq n4 (car (nth p4 s4))) (setq q4 (car (cdr (nth w4 s4)))) (setq f4 (car (cdr (nth p4 s4)))) (setq z4 (quotient (plus m4 n4) 2)) (setq x4 (quotient (plus q4 f4) 2)) (setq stack4 (list z4 x4)) (setq h4 (append h4 (list stack4))) (setq w4 (plus w4 1)) (setq p4 (difference p4 1)) (setq i4 (plus i4 1))) (for il4 0 (difference el4 1) (setq mn4 (car (nth t4 s4))) (setq nn4 (car (nth y4 s4))) (setq qn4 (car (cdr (nth t4 s4)))) (setq fn4 (car (cdr (nth y4 s4)))) (setq zn4 (quotient (plus mn4 nn4) 2)) (setq xn4 (quotient (plus qn4 fn4) 2)) (setq stackn4 (list zn4 xn4)) (setq h4 (append h4 (list stackn4))) (setq y4 (difference y4 1)) (setq t4 (plus t4 1)) (setq il4 (plus il4 1))) (setq a4 (cddr h4)) (setq wid4 (abs (difference f4 q4))) (if (nequal wid4 0) then (setq id4 (dbCreatePath cv mo a4 wid4)) (setq bboxrec4 (getSGq db bBox)) (setq bboxpoly4 (getSGq id4 bBox)) (if (equal bboxrec4 bboxpoly4) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec4 bboxpoly4) then (geDeselectAllFig) (geSelectFig id4) (dbDeleteObject id4))))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq s5 (getSGq db points)) (setq w5 (difference (quotient (length s5) 2) 2)) (setq p5 (difference w5 1)) (setq wo5 (difference (length s5) 1)) (setq po5 (plus (quotient (length s5) 2) 1)) (setq h5 (list 0 0)) (for i5 0 (difference (quotient (length s5) 2) 3) (setq m5 (car (nth w5 s5))) (setq n5 (car (nth p5 s5))) (setq q5 (car (cdr (nth w5 s5)))) (setq f5 (car (cdr (nth p5 s5)))) (setq z5 (quotient (plus m5 n5) 2)) (setq x5 (quotient (plus q5 f5) 2)) (setq stack5 (list z5 x5)) (setq h5 (append h5 (list stack5))) (setq w5 (plus w5 1)) (setq p5 (difference p5 1)) (setq i5 (plus i5 1))) (for io5 0 (difference (quotient (length s5) 2) 4) (setq mo5 (car (nth wo5 s5))) (setq no5 (car (nth po5 s5))) (setq qo5 (car (cdr (nth wo5 s5)))) (setq fo5 (car (cdr (nth po5 s5)))) (setq zo5 (quotient (plus mo5 no5) 2)) (setq xo5 (quotient (plus qo5 fo5) 2)) (setq stacko5 (list zo5 xo5)) (setq h5 (append h5 (list stacko5))) (setq wo5 (difference wo5 1)) (setq po5 (plus po5 1)) (setq io5 (plus io5 1))) (setq a5 (cddr h5)) (setq wid5 (abs (difference n5 m5))) (if (nequal wid5 0) then (setq id5 (dbCreatePath cv mo a5 wid5)) (setq bboxrec5 (getSGq db bBox)) (setq bboxpoly5 (getSGq id5 bBox)) (if (equal bboxrec5 bboxpoly5) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec5 bboxpoly5) then (geDeselectAllFig) (geSelectFig id5) (dbDeleteObject id5))))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq s6 (getSGq db points)) (setq v (plus (quotient (length s6) 2) 1)) (setq v1 (difference (quotient (difference (length s6) v) 2) 1)) (setq w6 (difference (length s6) 1)) (setq p6 (plus (quotient (length s6) 2) 1)) (setq wo6 (quotient (length s6) 2)) (setq po6 0) (setq h6 (list 0 0)) (for io6 0 (difference (quotient (length s6) 2) 4) (setq mo6 (car (nth wo6 s6))) (setq no6 (car (nth po6 s6))) (setq qo6 (car (cdr (nth wo6 s6)))) (setq fo6 (car (cdr (nth po6 s6)))) (setq zo6 (quotient (plus mo6 no6) 2)) (setq xo6 (quotient (plus qo6 fo6) 2)) (setq stacko6 (list zo6 xo6)) (setq h6 (append h6 (list stacko6))) (setq wo6 (difference wo6 1)) (setq po6 (plus po6 1)) (setq io6 (plus io6 1))) (setq h6 (reverse (cddr h6))) (for i6 0 v1 (setq m6 (car (nth w6 s6))) (setq n6 (car (nth p6 s6))) (setq q6 (car (cdr (nth w6 s6)))) (setq f6 (car (cdr (nth p6 s6)))) (setq z6 (quotient (plus m6 n6) 2)) (setq x6 (quotient (plus q6 f6) 2)) (setq stack6 (list z6 x6)) (setq h6 (append h6 (list stack6))) (setq w6 (difference w6 1)) (setq p6 (plus p6 1)) (setq i6 (plus i6 1))) (setq wid6 (abs (difference n6 m6))) (if (nequal wid6 0) then (setq id6 (dbCreatePath cv mo h6 wid6)) (setq bboxrec6 (getSGq db bBox)) (setq bboxpoly6 (getSGq id6 bBox)) (if (equal bboxrec6 bboxpoly6) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec6 bboxpoly6) then (geDeselectAllFig) (geSelectFig id6) (dbDeleteObject id6))))) (if (equal (getSGq db objType) "polygon") then (setq mo (getSGq db layer)) (setq s7 (getSGq db points)) (setq v (difference (quotient (difference (quotient (length s7) 2) 1) 2) 1)) (setq w7 (difference (quotient (length s7) 2) 2)) (setq p7 0) (setq wo7 (difference (length s7) 1)) (setq po7 (difference (quotient (length s7) 2) 1)) (setq h7 (list 0 0)) (for i7 0 v (setq m7 (car (nth w7 s7))) (setq n7 (car (nth p7 s7))) (setq q7 (car (cdr (nth w7 s7)))) (setq f7 (car (cdr (nth p7 s7)))) (setq z7 (quotient (plus m7 n7) 2)) (setq x7 (quotient (plus q7 f7) 2)) (setq stack7 (list z7 x7)) (setq h7 (append h7 (list stack7))) (setq w7 (difference w7 1)) (setq p7 (plus p7 1)) (setq i7 (plus i7 1))) (setq h7 (cddr h7)) (setq h7 (reverse h7)) (for io7 0 (difference (quotient (length s7) 2) 3) (setq mo7 (car (nth wo7 s7))) (setq no7 (car (nth po7 s7))) (setq qo7 (car (cdr (nth wo7 s7)))) (setq fo7 (car (cdr (nth po7 s7)))) (setq zo7 (quotient (plus mo7 no7) 2)) (setq xo7 (quotient (plus qo7 fo7) 2)) (setq stacko7 (list zo7 xo7)) (setq h7 (append h7 (list stacko7))) (setq wo7 (difference wo7 1)) (setq po7 (plus po7 1)) (setq io7 (plus io7 1))) (setq wid7 (abs (difference no7 mo7))) (if (nequal wid7 0) then (setq id7 (dbCreatePath cv mo h7 wid7)) (setq bboxrec7 (getSGq db bBox)) (setq bboxpoly7 (getSGq id7 bBox)) (if (equal bboxrec7 bboxpoly7) then (setq test (dbDeleteObject db))) (if (equal (getSGq db objType) "polygon") then (if (nequal bboxrec7 bboxpoly7) then (geDeselectAllFig) (geSelectFig id7) (dbDeleteObject id7))))) (if (equal (getSGq db objType) "path") then (hiDisplayAppDBox ?name (quote Error) ?dboxBanner "Error" ?dboxText (sprintf nil "Cannot convert Path to Path") ?buttonLayout (quote UserDefined) ?buttons (list "Close"))) (if (equal (getSGq db objType) "inst") then (hiDisplayAppDBox ?name (quote Errtor) ?dboxBanner "Error" ?dboxText (sprintf nil "Cannot convert Instance to Path") ?buttonLayout (quote UserDefined) ?buttons (list "Close"))) (if (equal test 0) then (hiDisplayAppDBox ?name (quote ERT) ?dboxBanner "Error" ?dboxText (sprintf nil "Path not Created, Still the script need tobe updated\n To create the path see the hints given above") ?buttonLayout (quote UserDefined) ?buttons (list "Close")))) (polytopath)