Jump to content

How to Hide or Delete ALL 2D Loci


gmm18

Recommended Posts

The problem is I am referencing a .dwg that has a bunch of 2D Loci in 100+ symbols.

These Loci are in the "0" Class, but so are all kinds of other objects, so I can't simply turn off that class.

How do I hide or remove them without manually editing each symbol?

They are really cluttering up the drawing, even though luckily they don't print.

THANKS.

Link to comment

Thanks Christian, but that doesn't work for deleting objects in symbols.

In Custom Selection there is an option to include Symbols in your selection, but in order to

delete those entities within your symbols you still need to edit each symbol

individually.

Any other thoughts?

Link to comment

How do I hide or remove them without manually editing each symbol?

With this little script. ( I've been in the same situation a few times.)

-------------------------------------copy lines below

PROCEDURE DelLociInSymDefs; { ? prit 2002 }

VAR

obHd : HANDLE;

sdHd : ARRAY[1..1000] OF HANDLE;

loci : ARRAY[1..100] OF HANDLE;

sName : STRING;

i, j, n, d : INTEGER;

PROCEDURE AddToSymDefArray (h : HANDLE);

BEGIN

n := n+1;

sdHd[n] := h;

END;

PROCEDURE AddToDeleteArray (h : HANDLE);

BEGIN

d := d+1;

loci[d] := h;

END;

PROCEDURE DeleteThem;

BEGIN

FOR j := 1 TO d DO

DELOBJECT(loci[j]);

END;

PROCEDURE DelLoci;

BEGIN

FOR i := 1 TO n DO BEGIN

obHd := FINSYMDEF(sdHd);

d := 0;

WHILE obHd<>NIL DO BEGIN

IF (GETTYPE(obHd)=17) THEN AddToDeleteArray(obHd);

obHd := NEXTOBJ(obHd);

END;

IF d>0 THEN DeleteThem;

END;

END;

BEGIN

FOR i := 1 TO NAMENUM DO BEGIN

obHd := GETOBJECT(NAMELIST(i));

IF GETTYPE(obHd)=16 THEN AddToSymDefArray(obHd);

END;

IF n>0 THEN DelLoci ELSE ALRTDIALOG('No symbol definitions found');

REDRAWALL;

END;

RUN(DelLociInSymDefs);

Link to comment

I ones had the same thing, but the loci were also in groups inside those symbols. That's why i wrote this script (not to diss you panta rhei, cause your script works fine if the loci are not in a group).

{maarten - 15 augustus 2008}
PROCEDURE VerwijderLocus;
VAR
NumSym : INTEGER;
SymHand : DYNARRAY of HANDLE;
tmpHand : HANDLE;
tel : INTEGER;


PROCEDURE DeleteLocussen(h : HANDLE);
BEGIN
	DelObject(h);
END;

BEGIN
{plaats de symbolen in de tekening}
NumSym:=SymDefNum;
ALLOCATE SymHand[1..NumSym];
tmpHand:=FSymDef;
FOR tel:=1 TO NumSym do
BEGIN
	Symbol(GetSDName(tmpHand),0,0,0);
	SymHand[tel]:=LNewObj;
	tmpHand:=NextSymDef(tmpHand);
END;
{verwijder alle locussen}
ForEachObject(DeleteLocussen,INSYMBOL & INVIEWPORT & (T=Locus));
{verwijder de symbolen}
FOR tel:=1 TO NumSym do	DelObject(SymHand[tel]);
RedrawAll;
END;
RUN(VerwijderLocus);

Link to comment

Thanks to all...

Both of the scripts worked.

It is interesting to start seeing how the script language works.

Maybe someday I will write my own...(or maybe I will just ask you first and save 1000 hours).

For some reason Pat, the Custom Visibility didn't work. FYI.

But I see that this command will be useful in the future for lots of other situations, thanks.

Link to comment

Good point: one does not necessarily want to lose the loci since they may have a purpose. At least my script can easily be modified to classify them.

Just change

PROCEDURE DeleteThem;

BEGIN

FOR j := 1 TO d DO

DELOBJECT(loci[j]);

END;

to

PROCEDURE ClassifyThem;

BEGIN

FOR j := 1 TO d DO

SETCLASS(loci[j], 'The Invisible Class');

END;

and

IF d>0 THEN DeleteThem;

to

IF d>0 THEN ClassifyThem;

(Ideally also some other changes in the nomenclature.)

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