Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've created a helper function to offset a circle and then change the color of the offset to blue. Within the helper function, I'm confused as to why (cons 62 circOSColor) has no effect on the color of the offset, but '((62 . 5)) does work. It seems you can't use variables in a dotted pair (either explicitly or with the cons function)?
Helper function:
(defun offsetCircle (entList circOffset circOSColor /)
; create circular offset
(vla-offset (vlax-ename->vla-object (cdr (car entList))) circOffset)
; change offset color
(setq offsetEList (entget (entlast)))
(setq offsetEList (append
(vl-remove (assoc '420 offsetEList)
offsetEList
)
(cons 62 circOSColor) ;'((62 . 5))
)
)
(entmod offsetEList)
)
Function call:
(setq circOffset 4) ; 4 inch offset (circle)
(setq circOSColor 5) ; offset color index (circle)
(offsetCircle entList circOffset circOSColor)
Solved! Go to Solution.