Style Merge

Style Merge

1wildwes
Collaborator Collaborator
3,457 Views
15 Replies
Message 1 of 16

Style Merge

1wildwes
Collaborator
Collaborator

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. 

0 Likes
Accepted solutions (1)
3,458 Views
15 Replies
Replies (15)
Message 2 of 16

RobDraw
Mentor
Mentor

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.
0 Likes
Message 3 of 16

pendean
Community Legend
Community Legend
Which styles exactly?

0 Likes
Message 4 of 16

ronjonp
Mentor
Mentor

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
Collaborator
Collaborator

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.

0 Likes
Message 6 of 16

RobDraw
Mentor
Mentor

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.
0 Likes
Message 7 of 16

cadffm
Consultant
Consultant

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

0 Likes
Message 8 of 16

pendean
Community Legend
Community Legend
>>>...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 🙂


0 Likes
Message 9 of 16

1wildwes
Collaborator
Collaborator

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.

0 Likes
Message 10 of 16

cadffm
Consultant
Consultant

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

Sebastian

0 Likes
Message 11 of 16

1wildwes
Collaborator
Collaborator

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.

0 Likes
Message 12 of 16

cadffm
Consultant
Consultant

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

0 Likes
Message 13 of 16

1wildwes
Collaborator
Collaborator

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? 

0 Likes
Message 14 of 16

cadffm
Consultant
Consultant

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

0 Likes
Message 15 of 16

cadffm
Consultant
Consultant
Accepted solution

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
Collaborator
Collaborator

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

0 Likes