Author Topic: entmod name of xref block definition (2 .  (Read 4295 times)

0 Members and 1 Guest are viewing this topic.

daron

  • Guest
Re: entmod name of xref block definition (2 .
« Reply #15 on: May 14, 2008, 01:05:40 PM »
Wow. Even worse. I would've thought breaking it up would've sped it up some. Sorry to put you through that. Go native lisp.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: entmod name of xref block definition (2 .
« Reply #16 on: May 14, 2008, 01:16:17 PM »
Daron,

Thanks for taking an interest :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

daron

  • Guest
Re: entmod name of xref block definition (2 .
« Reply #17 on: May 14, 2008, 03:09:13 PM »
No problem.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: entmod name of xref block definition (2 .
« Reply #18 on: May 14, 2008, 09:36:49 PM »
Does this do anything for your speed?
Code: [Select]
(defun c:matchxrnametofilename (/ blk path elst xname bname)
  (while (setq blk (tblnext "block" (not blk)))
    (and
      (setq path (cdr (assoc 1 blk))) ; has a path
      (setq xname (strcase (vl-filename-base path) t))
      (setq elst (entget (tblobjname "block" (setq bname (cdr(assoc 2 blk))))))
      (setq elst (entget (cdr (assoc 330 elst))))
      (/= xname (strcase bname t))
      (entmod (subst (cons 2 xname) (cons 2 bname) elst))
    )
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: entmod name of xref block definition (2 .
« Reply #19 on: May 14, 2008, 11:14:43 PM »
Even faster CAB :) < Elapsed time: 1.547 seconds. >

I've run into another issue....after running this code, XOPEN does not recognize the xrefs selected ("object selected is not an xref")...it's almost like they become unresolved?

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: entmod name of xref block definition (2 .
« Reply #20 on: May 14, 2008, 11:30:00 PM »
Cool.

I'll have some time tomorrow afternoon if you don't figure it out by then.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: entmod name of xref block definition (2 .
« Reply #21 on: May 15, 2008, 02:27:23 PM »
Ron,
Does the vla-put-name version have the same problem?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: entmod name of xref block definition (2 .
« Reply #22 on: May 15, 2008, 02:57:48 PM »
Ron,
Does the vla-put-name version have the same problem?

It does not....but it's rrreeeeaaaalllly slow?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: entmod name of xref block definition (2 .
« Reply #23 on: May 15, 2008, 03:02:23 PM »
Yea, just wanted to verify that it was the entmod version that had the problem.
Must be something else that needs to be renamed as well!
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: entmod name of xref block definition (2 .
« Reply #24 on: May 15, 2008, 03:09:31 PM »
The strange thing is it will unresolve the xref even if the entmod is not changing anything using my code (name already matches)? You can see the problem right away when using CLASSICXREF...the XREF palette does not refresh the changes.
« Last Edit: May 15, 2008, 03:22:32 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7531
Re: entmod name of xref block definition (2 .
« Reply #25 on: May 16, 2008, 09:49:28 AM »
You have not figured this one out yet CAB? :-P I'm stumped  :?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC