Author Topic: SHX or Shape file remove  (Read 5081 times)

0 Members and 1 Guest are viewing this topic.

Shade

  • Guest
SHX or Shape file remove
« on: March 30, 2009, 03:42:16 PM »
Does any one have a lisp that will remove all occurrences of a shape file (shx) from a drawing?
It would be great if it removed the shape file from the xrefs and blocks also.

I have a drawings that asks for a certain file that we do not use and canceling it when we open each drawing is a major pain for it occurs multiple times in some drawings.

Any help would be greatly appreciated.....

Thanks
Shade  :mrgreen:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: SHX or Shape file remove
« Reply #1 on: March 30, 2009, 04:44:19 PM »
You can allways replace the shape.
In the dwg create a shape using express tools Make Shape routine.
Use the same name as the missing shape.
You could use a point or a dot as your new shape.
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.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: SHX or Shape file remove
« Reply #2 on: March 30, 2009, 05:45:29 PM »
Hi,

Here's the routine I use. It replace not founded shape with AutoCAD "ltypeshp.shx".

Code: [Select]
(defun c:rform (/ ext)
  (vl-load-com)
  (vlax-for ts (vla-get-TextStyles
(vla-get-ActiveDocument (vlax-get-acad-object))
       )
    (if (and
  (setq ext (vl-filename-extension (vla-get-FontFile ts)))
  (= (strcase ext) ".SHX")
  (= 1 (cdr (assoc 70 (tblsearch "STYLE" (vla-get-Name ts)))))
  (not (findfile (vla-get-FontFile ts)))
)
      (vla-put-FontFile ts "ltypeshp.shx")
    )
  )
  (princ)
)
Speaking English as a French Frog