Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to remove SHX from "hidden" style

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
scottbolton
594 Views, 4 Replies

How to remove SHX from "hidden" style

Chaps,

 

I've received several drawings from a client and, of course, they're full of SHX's that I don't have. Getting a copy is not possible for politcal reasons.

 

If I delete everything in a drawing and purge the SHX's are still there.

 

I've located them in a STYLE but the name is "" (from entget: (2 . "")). Any ideas how to get rid of them or to modify the style to a new SHX?

 

S

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: scottbolton

(if
  (setq e (tblobjname "style" ""))
   (progn
     (setq ent (entget e))
     (entmod (subst (cons 3 "txt.shx") (assoc 3 ent) ent))
   )
)

Untested...

 

HTH

henrique

EESignature

Message 3 of 5
scottbolton
in reply to: hmsilva

Smiley Embarassed A little embarrassed - I had tried the same code but with DXF 2 to rename the style so that I could manipulate it but it didn't work. Didn't think of changing the SHX in 3.

 

Ta much.

 

Ah, but... there are several nameless styles, each with it's own SHX. (tblobjname will only select the first "" it comes to (that's why I'd tried to rename it with DXF 2). How to I get the subsequent styles? (tblnext doesn't return the <entity>.

Message 4 of 5
hmsilva
in reply to: scottbolton

Hi Scott,

 

try

(while
  (setq st (tblnext "style" (null st)))
   (if (= (cdr (assoc 2 st)) "")
     (setq st (subst (cons 3 "txt.shx") (assoc 3 st) st))
     (entmod st)
   )
)

and to rename, maybe something like this (untested)

(setq i 0)
(while (setq tblobj (tblobjname "style" ""))
  (entmod (setq	tblobj (entget tblobj)
		tblobj (subst (cons 2 (strcat "SHX-" (itoa i)) (assoc 2 tblobj) tblobj))
	  )
  )
  (setq 1+ i)
)

 

 

HTH

Henrique

EESignature

Message 5 of 5
owenwengerd
in reply to: hmsilva

Those "unnamed" styles are shape file references. FWIW, my SuperPurge utility purges those quickly and easily.

--
Owen Wengerd
ManuSoft

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

Post to forums  

”Boost