cono hacer array en autolisp
Publicado por carlos edu (1 intervención) el 03/05/2020 00:19:34
alguien sabe como se hacen arrays en autolisp, podrian hacer un ejemplo en un codigo pequeño
Valora esta pregunta


0
(defun c:6x4 ()
(setq objetos (ssget)
pt1 (getpoint "\nBase")
dist (mapcar '- (getcorner pt1) pt1)
)
(command "ARRAYRECT" objetos "" "B" pt1 "C" 4 6 "S" (cadr dist) (car dist) "X")
)
(defun c:Example_ArrayRectangular()
;; This example creates a circle and then performs
;; a rectangular array on that circle.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the circle
(setq center (vlax-3d-point 2 2 0)
radius 0.5)
(setq modelSpace (vla-get-ModelSpace doc))
(setq circleObj (vla-AddCircle modelSpace center radius))
(vla-ZoomAll acadObj)
(alert "Perform the rectangular array on the circle.")
;; Define the rectangular array
(setq numberOfRows 5
numberOfColumns 5
numberOfLevels 2
distanceBwtnRows 1.0
distanceBwtnColumns 1.0
distanceBwtnLevels 1.0)
;; Create the array of objects
(setq retObj (vla-ArrayRectangular circleObj numberOfRows numberOfColumns numberOfLevels
distanceBwtnRows distanceBwtnColumns distanceBwtnLevels))
(vla-ZoomAll acadObj)
(alert "Rectangular array completed.")
)