cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

We need an intelligent balloon delete option

We need an intelligent balloon delete option

If we try to delete a balloon with the delete component command the whole footprint deletes.  If we delete the balloon with regular AutoCAD delete, we have to also select each segment of the leader and the arrow.  Please allow the delete component command to detect that we are deleting a balloon and prompt to delete the leader and arrow also, but allow do no delete the component.  If we want the footprint deleted we will select the footprint.  If we do delete a footprint also delete the associated balloon, leader, and arrow.

 

Thanks!

 

Delete arrow and leader when a balloon is deleted.jpg

3 Comments
testsubject
Advisor

Doug,

 

Have you checked to see if Grouping somehow got turned off? I noticed that when this happens what you described happens.

 

 

Grouping is turned off because I sometimes need to grip and resize location boxes. So I would like an intelligent balloon delete that works similar to trim wire. It could even be a drop down choice under the insert balloon icon and an option when I right click over a balloon. But I like how some of the competitors have context driven delete. For example, ecscad used the same erase command for components, balloons, wires, etc.
rhesusminus
Mentor

Hi Doug.

 

I had nothing better to do (Yeah, right), so I made this code. Paste it into a lap-file, load it and run the ctaeDeleteBalloon command.

 

(defun padwithzero (number lengthofnumber /)					; Small routine to pad a number with X zeroes
  (while (< (strlen number) lengthofnumber)
    (setq number (strcat "0" number))
  )
)

(defun c:ctaeDeleteBalloon ()
  (setq oldpickstyle (getvar "PICKSTYLE"))
  (setvar "PICKSTYLE" 1)
  (setq selection (entsel "\nSelect balloon to delete :"))			; Select Balloon

  (if (= (c:wd_is_it_pnl (car selection)) "BAL")				; If anything was selected
    (progn
      (setq selectedballoon (car selection))
										; Get entityname of selected balloon
      (setq selectedballoonpointer						; get handle of selected balloon
	     (c:wd_get_1000_xdata
	       selectedballoon
	       "VIA_WD_HDL"
	     )
      )
      (setq footprints								; get the handles to the footprints that this balloon points to
	     (c:wd_delim_str_to_lst
	       (c:wd_get_1000_xdata
		 selectedballoon
		 "VIA_WD_BALLPTR"
	       )
	       ","
	     )
      )
      (if footprints
	(foreach footprint footprints
										; step through these footprints...
	  (progn
	    (setq numberofcatalogs
		   (+ (length
			(nth 1 (c:wd_bomr_entcat (handent footprint)))
		      )
		      1
		   )
	    )
	    (setq cnt 0)
	    (while (< cnt numberofcatalogs)
	      (if (= cnt 0)
		(setq xdataname "VIA_WD_BALLPTR")
		(setq xdataname
		       (strcat "VIA_WD_BALLPTR" (padwithzero (itoa cnt) 2))
		)
	      )

	      (progn
		(c:wd_mod_1000_xdata						; update the list of balloonpointers on the footprint
		  (handent footprint)
		  xdataname
		  ""
		)
		(setq cnt (+ cnt 1))
	      )
	    )
	  )
	)
      )
      (command "_.erase" selection "")
										; Erase the ballon (and it's group)
    )
    (princ "\nThat was not a balloon!")
  )										; end if Selected
  (setvar "PICKSTYLE" oldpickstyle)
  (princ)
)

 

It (temporarily) sets the pickstyle to 1 and then you select 1 of the ballons (if there are multiple on the arrow, just select one of them) on in the drawing. The ballon(s) and arrow is deleted, and the XDATA in the footprint pointing to the balloon(s) is deleted.

 

Please test. And if it's useful I'll put it into my AcadE toolbox (something I'm working on, soon available for the public at Autdesk Exchange), but then programmed in .NET (I hate LISP!) and then also support for selecting multiple balloons and so on 🙂

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report

”Boost