⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 find_dlines.il

📁 ALLEGRO SKILL SAMPLE CODE
💻 IL
📖 第 1 页 / 共 4 页
字号:
(defun findAllOfType (findType "t")
    (let (selSet oldSetData)
	(setq oldSetData (_saveSelSet))
	(axlClearSelSet)
	(axlSetFindFilter ?enabled  (list "noall" findType "invisible")
			  ?onButtons  (list "noall" findType))
	(axlAddSelectAll)
	(setq selSet (axlGetSelSet))
	(_restoreSelSet oldSetData)

	selSet))

;########################################################################
;#                                                                      #
;#                Function skillFindAll                                 #
;#                                                                      #
;########################################################################
(defun skillFindAll ()
    (let (selSet oldSetData)
	(setq oldSetData (_saveSelSet))
	(axlClearSelSet)
	(axlSetFindFilter ?enabled  (list  "all" )
			  ?onButtons  (list  "all" ))
	(axlAddSelectAll)
	(setq selSet (axlGetSelSet))
	(_restoreSelSet oldSetData)

	selSet)
);skillFindAll


;########################################################################
;#                                                                      #
;#                Function ashFindAllPins                               #
;#                                                                      #
;########################################################################
(defun ashFindAllPins ()
    (findAllOfType "PINS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllVias                               #
;#                                                                      #
;########################################################################
(defun ashFindAllVias ()
    (findAllOfType "VIAS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllClines                             #
;#                                                                      #
;########################################################################
(defun ashFindAllClines ()
    (findAllOfType "CLINES")
); end ashFindAllClines

;########################################################################
;#                                                                      #
;#                Function ashFindAllClinesegs                          #
;#                                                                      #
;########################################################################
(defun ashFindAllClinesegs ()
    (findAllOfType "CLINESEGS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllLines                              #
;#                                                                      #
;########################################################################
(defun ashFindAllLines ()
    (findAllOfType "LINES"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllLinesegs                           #
;#                                                                      #
;########################################################################
(defun ashFindAllLinesegs ()
    (findAllOfType "LINESEGS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllDrcs                               #
;#                                                                      #
;########################################################################
(defun ashFindAllDrcs ()
    (findAllOfType "DRCS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllText                               #
;#                                                                      #
;########################################################################
(defun ashFindAllText ()
    (findAllOfType "TEXT"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllShapes                             #
;#                                                                      #
;########################################################################
(defun ashFindAllShapes ()
    (findAllOfType "SHAPES"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllShapesegs                          #
;#                                                                      #
;########################################################################
(defun ashFindAllShapesegs ()
    (findAllOfType "SHAPESEGS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllVoids                              #
;#                                                                      #
;########################################################################
(defun ashFindAllVoids ()
    (findAllOfType "VOIDS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllVoidsegs                           #
;#                                                                      #
;########################################################################
(defun ashFindAllVoidsegs ()
    (findAllOfType "VOIDSEGS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllSymbols                            #
;#                                                                      #
;########################################################################
(defun ashFindAllSymbols ()
    (findAllOfType "SYMBOLS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllComponents                         #
;#                                                                      #
;########################################################################
(defun ashFindAllComponents ()
    (findAllOfType "COMPONENTS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllNets                               #
;#                                                                      #
;########################################################################
(defun ashFindAllNets ()
    (findAllOfType "NETS"))

;########################################################################
;#                                                                      #
;#                Function ashFindAllFigures                            #
;#                                                                      #
;########################################################################
(defun ashFindAllFigures ()
    (findAllOfType "FIGURES"))

;########################################################################
;#                                                                      #
;#                Function skillMakeDangList                            #
;#                                                                      #
;########################################################################
(defun skillMakeDangList ()
	setof( n ashFindAllClines() n->net->name == nil || n->net->name == "")
);skillMakeDangList

;########################################################################
;#                                                                      #
;#                Function skillDeleteOneDrc                            #
;#                                                                      #
;########################################################################
(defun skillDeleteOneDrc ()
  (foreach oneDRC (ashFindAllDrcs)
	(case oneDRC~>name
		("Externally Determined Violation"
                      if(oneDRC->xy == car(car(car(selected_dbid)->segments)->startEnd)
                        axlDeleteObject( oneDRC )
                      ); endif
                      )
		( t nil)
	);case
  );foreach
);skillDeleteDrcs


;########################################################################
;#                                                                      #
;#                Function skillDeleteDrcs                              #
;#                                                                      #
;########################################################################
(defun skillDeleteDrcs ()
  (foreach oneDRC (ashFindAllDrcs)
	(case oneDRC~>name
		("Externally Determined Violation" axlDeleteObject( oneDRC ))
		( t nil)
	);case
  );foreach
);skillDeleteDrcs

;########################################################################
;#                                                                      #
;#                Function skillDehighlightAll                          #
;#                                                                      #
;########################################################################
(defun skillDehighlightAll ()
axlDehighlightObject(skillFindAll())
)

;########################################################################
;#                                                                      #
;#                Function lcbMakeLineList                              #
;#                                                                      #
;########################################################################
; Try to find all line segments on the Class, ETCH.
(defun lcbMakeLineList ()
    setof(n ashFindAllLines() (car(parseString(n->layer "/")) == "ETCH" || car(parseString(n->layer "/")) == "CONDUCTOR" ));[Joshua] For using in PCB Editor, add OR function for "ETCH".
);lcbMakeLineList

;########################################################################
;#                                                                      #
;#                Function lcbMakeDrc                                   #
;#                                                                      #
;########################################################################
; Make a function that will take a list, an error message, and an
; output file name as arguments and will create the DRC markers
; and report files.
(defun lcbMakeDrc (l_dang formfield errmsg)
 prog( ()
  (foreach oneLine l_dang
         theLine = oneLine
         onesegX = xCoord(car(car(theLine->segments)->startEnd))
         onesegY = yCoord(car(car(theLine->segments)->startEnd))

         ; Use the dbid and XY in the form
         sprintf(snum "%L" car(oneLine->segments)->startEnd)

         ; Make an associative list
         l_alldang = append(l_alldang list(list(snum oneLine)))

         layer = theLine->layer
         subclass = cadr(parseString(layer "/"))
         drcLayer = strcat( "drc error class/" subclass)
         axlDBCreateExternalDRC( errmsg, onesegX:onesegY, drcLayer)
         axlFormSetField(Form formfield list(snum) )
  );foreach


   ;Highlight each cline/line
   axlHighlightObject( l_dang)


   ; return with the number of errors.
   return()

 ); end prog
); end lcbMakeDrc

;########################################################################
;#                                                                      #
;#                Function _createForm                                  #
;#                                                                      #
;########################################################################
(defun _createForm ()
 form_file = "find_dlines.form"
 form = outfile(form_file "w")
 fprintf(form "FILE_TYPE=FORM_DEFN VERSION=2\n")
 fprintf(form "FORM\n")
 fprintf(form "FIXED\n")
 fprintf(form "PORT 67 20\n")
 fprintf(form "HEADER \"Find Dangling Clines and Dangling Lines\"\n")
 fprintf(form "\n")
 fprintf(form "POPUP <PRINTP>\"to File\"\"0\",\"to Printer\"\"1\",\"to Script\"\"2\".\n")
 fprintf(form "\n")
 fprintf(form "\n")
 fprintf(form "TILE\n")
 fprintf(form "TEXT \"*********************************************************************\"\n")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -