Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I keep getting a "error: bad argument type: numberp: OS" error when I run this code, specifically after I select the object, which I assume is because the error happens when os is called upon with the two mapcar functions. I've previously made functions using this exact format using real numbers in the place of the os variable, so I am unsure how setting os as real would make this any different.
(defun c:OffsetBX (/ os eName mn mx mno mxo)
(vl-load-com)
(setq os (getreal "\nOffset Amount: "))
(if (setq eName (car (entsel "\n >> Select Object >> ")))
(progn
(vla-getboundingbox (vlax-ename->vla-object eName) 'mn 'mx)
(vl-cmdf "._rectang"
(mapcar '- (vlax-safearray->list mn) '( os os))
(mapcar '+ (vlax-safearray->list mx) '( os os)))
)
)
(princ)
)
Thanks in advance for your help.
Solved! Go to Solution.