Kayıtlar

Ocak, 2024 tarihine ait yayınlar gösteriliyor

kırmızı renkli ve çizgi tipi ölçeği 1

AutoCAD'de kırmızı renkli ve çizgi tipi ölçeği 1 olan çizgileri bulmak istiyorsanız basit bir AutoLISP programı oluşturabilirsiniz. Program, çizimdeki tüm objeleri yineleyecek ve kriterlerinizi karşılayan çizgileri belirleyecektir. (defun c:FindRedLines () (vl-load-com) (setq redLines '()) ; List to store red lines (vlax-for obj (vla-get-ActiveDocument (vlax-get-acad-object)) (if (= "AcDbLine" (vla-get-objectname obj)) ; Check if the entity is a line (progn (setq color (vla-get-color obj)) (setq linetype-scale (vla-get-linetype-scale obj)) ; Check if the line is red and linetype scale is 1 (if (and (= color 1) (= linetype-scale 1.0)) (setq redLines (cons obj redLines)) ) ) ) ) ; Highlight or process the red lines as needed (if redLines (progn (foreach line redLines ; Do something with each red line (e.g., highlight or print information) (vla-put

Blok Yerleştir

Bu AutoLISP programı, çizimdeki daireleri arayan ve belirtilen bloğu merkezlerine yerleştiren c:PlaceBlocks adlı bir işlevi tanımlar. Program, eklemeyi denemeden önce çizimde "block01" adlı bloğun var olup olmadığını kontrol eder. Blok bulunamazsa bir uyarı görüntülenir. (defun c:PlaceBlocks () (setq blockName "block01") ; Specify the name of the block to be inserted (if (not (tblsearch "block" blockName)) (alert (strcat "Block '" blockName "' not found. Please insert the block first.")) (progn (setq circles (ssget "X" '((0 . "CIRCLE")))) (if circles (progn (repeat (sslength circles) (setq circle (entget (ssname circles 0))) (setq centerPt (cdr (assoc 10 circle))) ; Extract the center point of the circle ; Insert the block at the center of the circle (command "_.insert" blockName centerPt 1.0 1.0 0.0)

Polyline vertex bul

(defun c:FindPolylineVertices () (setq polyLine (car (entsel "\nSelect a polyline: "))) (if (and polyLine (eq 'POLYLINE (cdr (assoc 0 (entget polyLine))))) (progn (setq vertices (getPolylineVertices polyLine)) (if vertices (progn (setq count 1) (foreach vertex vertices (princ (strcat "\nVertex " (itoa count) ": " (vl-princ-to-string vertex))) (setq count (1+ count)) ) ) (princ "\nNo vertices found.") ) ) (princ "\nSelected entity is not a polyline.") ) (princ) )