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

Style Merge

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
1wildwes
2679 Views, 15 Replies

Style Merge

Is there a way to merge styles without using the Standards? Are there good lisp routines that will do this? I know this is an ancient question. 

Tags (2)
15 REPLIES 15
Message 2 of 16
RobDraw
in reply to: 1wildwes

I used to have one for merging text styles.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 3 of 16
pendean
in reply to: 1wildwes

Which styles exactly?

Message 4 of 16
ronjonp
in reply to: 1wildwes

Sledgehammer approach to force all objects style to standard.

(defun c:foo (/ a d)
  ;; RJP » 2019-10-02
  (vlax-for l (vla-get-layers (setq d (vla-get-activedocument (vlax-get-acad-object))))
    (cond ((= -1 (vlax-get l 'lock)) (vlax-put l 'lock 0) (setq a (cons l a))))
  )
  (vlax-for b (vla-get-blocks d)
    (vlax-for o	b
      (if (vlax-property-available-p o 'stylename)
	(vl-catch-all-apply 'vla-put-stylename (list o "Standard"))
      )
    )
  )
  (foreach l a (vlax-put l 'lock -1))
  (vla-regen d acallviewports)
  (princ)
)
(vl-load-com)
Message 5 of 16
1wildwes
in reply to: pendean

I was directed to one on The Swamp. It seems to work but my dwg still needs cleaning. I'm trying to merge unwanted styles to a user style, not Standard. These unwanted styles are in use.

Message 6 of 16
RobDraw
in reply to: 1wildwes

There are several LISP routines out there for merging styles. Which styles would you like to merge?


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 7 of 16
cadffm
in reply to: 1wildwes

You can not purge styles in use, that incl. the current style because this style is in use...as the current style.

And there is one special thing, that normal BTN tools not handle:

 

Merging shouldn't be a problem (have you problems with merging, or just with clean/purging?

You can not clean/purge the first style in your drawing, normally it is the STANDARD style, but everyone is able

to rename style, also 'Standard'.

 

For example:

Standard is the first and Style1 a second one.

you can not purge the STANDARD style.

I rename 'Standard' to "AAA", rename 'Style1' to 'Standard',

now "AAA" is the first style and you can not this one (because it was and is the first style, just the name changed)

 

First style in your file is

Command: (cdr(assoc 2 (tblnext "STYLE" T)))

Sebastian

Message 8 of 16
pendean
in reply to: 1wildwes

>>>...but my dwg still needs cleaning...<<<
Then it is time to buy a true purge fix https://www.manusoft.com/software/superpurge.html
Just be careful what you ask for, once those genies come out of that bottle all bests are off 🙂


Message 9 of 16
1wildwes
in reply to: RobDraw

I'm trying to merge several styles into 1 user style, not Standard. It says these styles are in use but I haven't been able to find them. The only C3D styles in the dwg are standard. I found the attached lisp that almost merged all but there are a couple left.

Tags (2)
Message 10 of 16
cadffm
in reply to: 1wildwes

Post your DWG (after MTS), it' easier to see where the style is in use 😉

Sebastian

Message 11 of 16
1wildwes
in reply to: cadffm

Here is the dwg with almost everything erased. The styles are still there. The only Styles I'm concerned with are the Simplex-3 and Simplex-4, which I want to merge to Simplex.

Tags (2)
Message 12 of 16
cadffm
in reply to: 1wildwes

Never ask for some strange things if the file contains corrupt data 😉

Open the file by RECOVER or just run AUDIT,

then try it again.

Simplex-3/4 are part of corrupt or lost tablestyle fragments.

 

AUDIT yes

 

Sebastian

Message 13 of 16
1wildwes
in reply to: cadffm

I had already tried that several times and just did it again. I am not getting any error messages. Also tried -wblock for the entire dwg. I'm on C3D 2019. What version are you using? Is there a way to see the table fragments listed in the dwg? 

Message 14 of 16
cadffm
in reply to: 1wildwes

Not possible to purge after

audit/yes 

Purge All (incl.orphraned data)

 

Sorry i am away from PC now, and perhaps...

I will check it

later/tomorrow/tgis weekend/no later than Monday.

but i was able to purge both style.

Audit or recovet

Purge.. what i missed?

 

>" Is there a way to see the table fragments listed in the dwg?"

No.

Sebastian

Message 15 of 16
cadffm
in reply to: cadffm

Hi again.

 

Open the file by RECOVER

Use

Command -Purge all

 

or create a new layer for example

-la new 123

then use Purge dialog to purge all 

Sebastian

Message 16 of 16
1wildwes
in reply to: cadffm

Oh jeez I've just been doing regular purge. So sorry and thanks for the help.

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report