Author Topic: multiple xrefs....  (Read 7630 times)

0 Members and 1 Guest are viewing this topic.

Bob Wahr

  • Guest
Re: multiple xrefs....
« Reply #15 on: September 16, 2005, 03:02:41 PM »
Guess by the lack of any additional response it either worked or he gave up.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: multiple xrefs....
« Reply #16 on: September 16, 2005, 03:26:08 PM »
Bob,

That did work.....cept it detaches all xrefs in the drawing. I need to be able to select which xref to detach.

Thanks for the help.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Bob Wahr

  • Guest
Re: multiple xrefs....
« Reply #17 on: September 16, 2005, 03:28:34 PM »
That would be easy to add.  Did you want to pick one on screen, pick from a list, type in the name, all of the above?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: multiple xrefs....
« Reply #18 on: September 16, 2005, 03:36:30 PM »
All of the above would be great :). I don't know why AutoCAD doesn't have this functionality out of the box :evil:.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Bob Wahr

  • Guest
Re: multiple xrefs....
« Reply #19 on: September 16, 2005, 03:42:21 PM »
don't have the time or to be truthful the inclination to do it all at least this afternoon.  I will however

a) give you the help you need to make it do all of the above
2) give you one of the above options
or lastly) discuss my rates for completing it per your specs ;)

ronjonp

  • Needs a day job
  • Posts: 7529
Re: multiple xrefs....
« Reply #20 on: September 16, 2005, 03:54:14 PM »
The option to select would be good.

As far as compesation goes....you like beer? I'll be in Tucson in May for a wedding. ;-)

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: multiple xrefs....
« Reply #21 on: September 16, 2005, 03:55:49 PM »
I'll be in Tucson in May for a wedding. ;-)

Thanks,

Ron
let us know when, as beer is always cold here
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bob Wahr

  • Guest
Re: multiple xrefs....
« Reply #22 on: September 16, 2005, 05:55:26 PM »
I'm all for the beer.  It's going to have to be Monday though.  That work thing is interfering again.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: multiple xrefs....
« Reply #23 on: September 16, 2005, 06:22:04 PM »
I hacked together something that seems to be working alright:

Code: [Select]
;;  Function to detach xref that has multiple references

(defun c:dx (/ ent obj x ss index eobj oname lyr)
 (vl-load-com)
  (while
    (= ent nil)
     (setq ent (car (entsel "\n Select Xref to Detach: ")))
     (if (= ent nil)
       (alert "\n You missed, try again...")
     )
  )
(setq obj (vlax-ename->vla-object ent)
      oname (substr (vla-get-ObjectName Obj)5)
      lyr   (vla-get-Layer Obj)
)
  (if
    (and
      (= (vla-get-ObjectName Obj) "AcDbBlockReference")
      (vlax-property-available-p Obj 'Path)
    )
     (progn
       (setq x    (vlax-get-property obj 'Name)
     ss    (ssget "x" (list (cons '2 x)))
     index -1
       )
       (while (< (setq index (1+ index)) (sslength ss))
(setq obj  (ssname ss index)
       eobj (vlax-ename->vla-object obj)
)
(vla-delete eobj)
       )
     )
     (alert (strcat "\n This program does not work with " oname "s!" "\n" "\n  Please select an Xref."))
  )
  (command "._xref" "D" x)
  (princ (strcat "Xref Name = " x "  --  " (itoa index) " instances deleted and detached.")
  )
  (princ)
)

I won't be there on Monday....we can figure things out.

Cmdr...I'll keep you posted as well. It would be cool to meet some of the "swampers"

Ron
« Last Edit: September 23, 2005, 10:37:15 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrea

  • Water Moccasin
  • Posts: 2372
Re: multiple xrefs....
« Reply #24 on: September 17, 2005, 04:38:18 PM »
Quote
simply use....


OVERKILL  command.
No workie...
objblk.Detach

Ron


heun !!?? Working for me... :-o
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Re: multiple xrefs....
« Reply #25 on: September 19, 2005, 01:28:15 PM »
Andrea,

Try this:

Xref a drawing onto one paperspace tab. Copy it and paste on another pspace tab.

Now try to detach it.

You should recieve an error "Xref ... has multiple references. Not detached."

Overkill I believe is to find objects on top of objects and deletes the duplicates, has nothing to do with detaching xrefs.

Ron


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Bob Wahr

  • Guest
Re: multiple xrefs....
« Reply #26 on: September 22, 2005, 11:57:58 AM »
ronjonp, I let this drop because you got it worked out in lisp.  Are you happy with what you have or do you want to continue with the VBA thingy?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: multiple xrefs....
« Reply #27 on: September 22, 2005, 12:00:13 PM »
This seems to be working out alright. Thanks for checking.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Bob Wahr

  • Guest
Re: multiple xrefs....
« Reply #28 on: September 22, 2005, 12:00:40 PM »
no problem.