Accoes Posted June 8, 2017 Posted June 8, 2017 (edited) I'm trying to get this to innerate though several pieces of ductwork but only writes to first piece. Any idea what i'm missing (defun c:doda () (vl-load-com) (setq bb (getstring 1 "\nEnter Text:")) (setq ss (ssget)) (if ss (setq len (sslength ss) cnt 0 ) (while (< cnt len) (setq entity (LEN ss 0) vlaobj (vlax-ename->vla-object entity)) (vlax-put-property vlaobj 'notes bb) ) ) ) Edited June 9, 2017 by Accoes code tags Quote
guitarguy1685 Posted June 8, 2017 Posted June 8, 2017 (defun c:doda () (vl-load-com) (setq bb (getstring 1 "\nEnter Text:")) (setq ss (ssget)) (if ss (setq len (sslength ss) cnt 0 ) (while (< cnt len) (setq entity (LEN ss 0) [color="red"] ;;;what's going on here?[/color] vlaobj (vlax-ename->vla-object entity)) (vlax-put-property vlaobj 'notes bb) ) ) ) Quote
Accoes Posted June 8, 2017 Author Posted June 8, 2017 Autodesk fabrication. DBX only. It will allow you to write to this property. Need to separate duct to AHU units instead of by system for facilities(maximo) Was setting counter to zero Quote
guitarguy1685 Posted June 8, 2017 Posted June 8, 2017 I was asking because I want to try to replicate your results on my rig. I'm no expert but that line looks like it should error out. Is LEN a subroutine? (LEN ss 0) Quote
BIGAL Posted June 9, 2017 Posted June 9, 2017 My $0.05 worth (defun c:doda () (vl-load-com) (setq bb (getstring 1 "\nEnter Text:")) (setq ss (ssget)) (if ss (repeat (setq len (sslength ss)) (setq vlaobj (vlax-ename->vla-object (ssname ss (setq len (- len 1))))) (vlax-put-property vlaobj 'notes bb) ) ) ) Quote
Accoes Posted June 9, 2017 Author Posted June 9, 2017 My $0.05 worth (defun c:doda () (vl-load-com) (setq bb (getstring 1 "\nEnter Text:")) (setq ss (ssget)) (if ss (repeat (setq len (sslength ss)) (setq vlaobj (vlax-ename->vla-object (ssname ss (setq len (- len 1))))) (vlax-put-property vlaobj 'notes bb) ) ) ) That's a winner. Thx Quote
SLW210 Posted June 9, 2017 Posted June 9, 2017 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.