Jump to content

Recommended Posts

Posted (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 by Accoes
code tags
Posted

what kind of objects are you selecting?

Posted
(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)
     )
   )
 )

Posted

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

Posted

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)

Posted

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)
   )
  )
)

Posted
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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...