gmm18 Posted November 26, 2008 Share Posted November 26, 2008 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. Quote Link to comment
Christiaan Posted November 26, 2008 Share Posted November 26, 2008 Tools > Custom Selection... Options: Select Only Criteria: Type is 2D Locus (or 3D Locus) Quote Link to comment
gmm18 Posted November 26, 2008 Author Share Posted November 26, 2008 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? Quote Link to comment
M.CH Posted November 26, 2008 Share Posted November 26, 2008 Just deselect Snap to loci in VW Preferences>Edit Quote Link to comment
panta rhei Posted November 26, 2008 Share Posted November 26, 2008 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); Quote Link to comment
Pat Stanford Posted November 27, 2008 Share Posted November 27, 2008 The other option is to edit your workspace and add the Custom Visibility command from the Legacy commands set. This will let you turn off the visibility of the loci. I recommend that you use the command to make two scripts. 1. Hide Loci 2. Show All Pat Quote Link to comment
maarten. Posted November 27, 2008 Share Posted November 27, 2008 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); Quote Link to comment
gmm18 Posted November 27, 2008 Author Share Posted November 27, 2008 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. Quote Link to comment
J. Miller Posted November 29, 2008 Share Posted November 29, 2008 Another method that i use is to put symbol locus in their own class. That way you have the ability to turn them on & off easily. Jeff Miller Quote Link to comment
panta rhei Posted November 29, 2008 Share Posted November 29, 2008 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.) Quote Link to comment
Recommended Posts
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.