Jump to content

symbol by class


bonus

Recommended Posts

Hi Pat

What I want is line colors and class assignements in the symbol to switch to the new class default color/assignment when I change class in the OIP.

But I understand the symbols are locked and should be so to preserve their settings.

What I'm about to do is to convert all my layers and classes in a document to fit to ACAD standards. They absolutely want colors to be by layer in all details of the symbols.

I've done it as described above and that works fine.

Link to comment

If these are really symbols (not Plug-ins or containers of Plug-Ins) this script should change the class of all the contained objects to match the class of the selected symbol. If you want to have the same symbol in different classes, you will need to make duplicates for each class required.

Procedure SetSymbolContentsToClass;

Var H1,H2:Handle;

S1,S2,S3:String;

N1:Integer;

Function DoIt(H3:Handle) : boolean;

Begin

SetFillColorByClass(H3);

SetFPatByClass(H3);

SetLSByClass(H3);

SetLWByClass(H3);

SetMarkerByClass(H3);

SetOpacityByClass(H3);

SetPenColorByClass(H3);

SetMarkerByClass(H3);

SetClass(H3,S1);

End;

Begin

N1:=0;

H1:=FSActLayer;

If GetType(H1)<>15 then

AlrtDialog('Select a symbol instance and run the script again')

else

Begin

S2:=GetSymName(ActSymDef); {Store active symbol def to reset later}

SetActSymbol(GetSymName(H1));

H2:=ActSymDef;

S1:=GetClass(H1);

ForEachObjectInList(DoIt,0,2,FinSymDef(H2));

SetActSymbol(S2);

RedrawAll;

end;

End;

Run(SetSymbolContentsToClass);

Link to comment

Than you Ray

I twice tried the first quick way to do it, but at the end VW did not recognize the .VS file as a script file. So there was no way to press OK.

I also tried to name an empty file with.VS, but no....

I'll read through the other two methods later.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...