Jump to content

Recommended Posts

Posted

I am feeling particularly ignorant today. Why can't I get the below code to properly attach the xdata to the line?

 

 
 (while (setq PT1 (getpoint "\nPick the leader endpoint: "))
   (setq PT2 (getpoint PT1 "\nPick the tag center point: "))
   (setq DS (getvar "dimscale"))
   (setq ANG (angle PT2 PT1))
   (setq DIST (distance PT1 PT2))
   (setq LDRPT (polar PT2 ANG RAD))
   (command "line" PT1 LDRPT "")
   (setq LnEnt (entget(entlast)))
   (setq LnHndl (cdr (assoc 5 LnEnt)))
   (command "INSERT" "BALLOON" PT2 DS DS 0 TAGNUM)
   (setq BlnEnt (entget(entlast)))
   (setq BlnHndl (cdr (assoc 5 BlnEnt)))

   ;add entity handles to other entity
   (regapp "GP_Balloon")
   (princ "\n1")
   (setq exdata '((-3 ("GP_Balloon" (1005 . eval(LnHndl))))))
   (princ "\n2")
   (setq newent (append BlnEnt exdata))
   (princ "\n3")
   (entmod newent)
   (princ "\n4")
   
   (setq TAGNUM (1+ TAGNUM))
 )
 (redraw)

 

I added the (princ "\n#") lines as a pointer for failure analysis. I get 1, 2, & 3. Looking at it I think my problem is with the (setq exdata... line.

 

Any help would be appreciated.

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