TheSwamp

CAD Forums => Vertically Challenged => Land Lubber / Geographically Positioned => Topic started by: MSTG007 on September 21, 2016, 09:39:39 AM

Title: Delete Point All Groups
Post by: MSTG007 on September 21, 2016, 09:39:39 AM
I am just curious if there is a routine that can quickly delete all point groups in a dwg?
Title: Re: Delete Point All Groups
Post by: Jeff_M on September 21, 2016, 09:47:47 AM
I wrote this eons ago to delete duplicate point groups (those created when you insert one C3D dwg into another containing the same named pg's). it could be easily modified so it deletes all except the _All Points group.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:deletePGdups (/ C3D C3DDOC GROUPS GROUPSTOREMOVE)
  2.            (setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
  3.                              (if vlax-user-product-key
  4.                                (vlax-user-product-key)
  5.                                (vlax-product-key)
  6.                              )
  7.                      )
  8.                  C3D (vl-registry-read C3D "Release")
  9.                  C3D (substr
  10.                        C3D
  11.                        1
  12.                        (vl-string-search
  13.                          "."
  14.                          C3D
  15.                          (+ (vl-string-search "." C3D) 1)
  16.                        )
  17.                      )
  18.                  C3D (vla-getinterfaceobject
  19.                        (vlax-get-acad-object)
  20.                        (strcat "AeccXUiLand.AeccApplication." C3D)
  21.                      )
  22.            )
  23.            (setq C3Ddoc (vla-get-activedocument C3D))
  24.            (setq groups (vlax-get C3Ddoc 'pointgroups));;this line was omitted
  25.       )
  26.     (progn
  27.       (vlax-for grp groups
  28.         (if (wcmatch (vlax-get grp 'name) "*.#,*.##")
  29.           (setq groupstoremove (cons grp groupstoremove))
  30.         )
  31.       )
  32.       (if groupstoremove
  33.         (foreach grp groupstoremove
  34.           (vlax-invoke groups 'remove grp)
  35.         )
  36.       )
  37.       (vlax-release-object C3D)
  38.     )
  39.   )
  40.   (princ)
  41. )
  42.  
Title: Re: Delete Point All Groups
Post by: MSTG007 on September 21, 2016, 09:52:00 AM
LOL> that is exactly what I am dealing with. Ever since I upgraded to SP3. Drawings take forever to load, unless I manually delete all the point groups. Save, then everything is back to normal performance... Thanks a HUGE lots Jeff.
Title: Re: Delete Point All Groups
Post by: MSTG007 on September 21, 2016, 10:04:12 AM
Jeff,

I am trying to figure out why I am getting this error. What version was this made for?

Code: [Select]
; error: bad argument type: VLA-object collection: nil
Title: Re: Delete Point All Groups
Post by: Jeff_M on September 21, 2016, 10:40:44 AM
Well, not sure how that happened but one line was missing from the code. I've updated the code above so it now works as expected.

BTW, SP3 does some magic when saving to eliminate some stuff in drawings that should not have been here. That 'stuff' was causing long load times, after saving the load times are significantly decreased. At least until someone without SP3 opens & saves, at which point that 'stuff' will come back.
Title: Re: Delete Point All Groups
Post by: MSTG007 on September 21, 2016, 10:42:22 AM
lol... Not really what I wanted to hear about someone who does not have SP3 and saving. I will try to make sure everyone here has it updated.
Title: Re: Delete Point All Groups
Post by: nobody on September 23, 2016, 07:45:06 AM
Well, not sure how that happened but one line was missing from the code. I've updated the code above so it now works as expected.

BTW, SP3 does some magic when saving to eliminate some stuff in drawings that should not have been here. That 'stuff' was causing long load times, after saving the load times are significantly decreased. At least until someone without SP3 opens & saves, at which point that 'stuff' will come back.

mind if I ask what version of C3D this refers to?
Title: Re: Delete Point All Groups
Post by: MSTG007 on September 23, 2016, 07:50:34 AM
Works with Civil3D 2016 and 2017.
Title: Re: Delete Point All Groups
Post by: Jeff_M on September 23, 2016, 08:52:30 AM
Well, not sure how that happened but one line was missing from the code. I've updated the code above so it now works as expected.

BTW, SP3 does some magic when saving to eliminate some stuff in drawings that should not have been here. That 'stuff' was causing long load times, after saving the load times are significantly decreased. At least until someone without SP3 opens & saves, at which point that 'stuff' will come back.

mind if I ask what version of C3D this refers to?
Affects 2013-2017. Fixes for 2014 & 2015 available, SP2 doe 2016 & SP1.1 for 2017 contain the fix.
Title: Re: Delete Point All Groups
Post by: Dent Cermak on December 16, 2016, 09:56:22 AM
Ask a question. Get a custom LISP file. Sometimes it works. Sometimes it doesn't.  :whistling:

Simple solution? Look in the project folder where your survey data is located. See a *****.grp file ? Erase it. ALL point groups gone-gone.

To delete individual groups use your Point Group Manager pull down.

Individual points are removed using your coordinate file editor.

I don't like a complicated life style. Computers frazzle me enough without trying to write code.

Title: Re: Delete Point All Groups
Post by: Jeff_M on December 16, 2016, 11:36:05 AM
What do you mean, Dent? "Sometimes works..sometimes doesn't"
It sounds like you provided a sloution for use in Land Desktop (or even Softdesk 8). The OP was asking about Civil3D.
Title: Re: Delete Point All Groups
Post by: Dent Cermak on December 16, 2016, 11:34:47 PM
Admiditly I am using Carlson, but the C3D types in the office do the same thing on a daily basis. And my Carlson is on top of C3D. What can I say?  :whistling:
Title: Re: Delete Point All Groups
Post by: BlackBox on December 17, 2016, 05:15:41 PM
Interesting thread; I haven't heard of Carlson since the days of Eagle Point software. Haha

Why do you use Carlson on top of C3D, dent?


Cheers
Title: Re: Delete Point All Groups
Post by: MSTG007 on December 17, 2016, 08:28:58 PM
So far I have heard eagle point, soft desk, LDD, civil3d and are we missing any more???? What's Bentley have? Their civil package?
Title: Re: Delete Point All Groups
Post by: BlackBox on December 17, 2016, 10:46:00 PM
Haha - Geopack or InRoads?
Title: Re: Delete Point All Groups
Post by: Dent Cermak on December 20, 2016, 09:23:25 PM
Interesting thread; I haven't heard of Carlson since the days of Eagle Point software. Haha

Why do you use Carlson on top of C3D, dent?


Cheers

Carlson is alive and well and is the software of choice in my area among several smaller firms. With the new pricing structure Autodesk has come up with. several of the larger firms are looking at Carlson products.

I do not use Carlson on top of AutoCAD. Mine is a standalone package. The engineering types use it on top of Autodesk, which is a horrible waste of money in my opinion, because they say the program is easier to use, gives the same results and much more "intuitive". (I do not explain architects or engineers. Don't ask)

The company that I am with now is looking to open a Carlson Training Center to help people in the transition. The Boss thinks that a change is coming in our area and a training center will work well. When you live in the poorest state in the union, people are looking to save a buck wherever they can without sacrificing  accuracy or quality of work. So far we have had no problems in that area.

I realize that EVERYONE here is an AutoCAD fanatic and are very hesitant to change, I was too, but then we hit that economic wall that we could not ignore. It's all about the Benjamin's! So far we have lost nothing and have a product we can use that is fully compatible with our client's needs.

I just looked at this thread and saw something that I am able to do easily and automatically and the threads seemed to say this capability was not built in, so here's a lisp routine to fix that. Caught me a little off guard. Surely AutoCAD has a points pull down with this item as an option?
Title: Re: Delete Point All Groups
Post by: Jeff_M on December 20, 2016, 10:23:42 PM
Surely AutoCAD has a points pull down with this item as an option?
Nope, hence the reason for posting the lisp....nor is there an external file to just delete as you previously suggested (the Survey point groups may have this, but I don't use the Survey database).
Title: Re: Delete Point All Groups
Post by: Dent Cermak on December 21, 2016, 09:34:10 AM
Are you saying that there is no way built into AutoCAD to fully edit your coordinate file? Delete, edit, etc.?? Wow!! That will be a MAJOR issue especially once the drone technology goes full bore. Those are Huge files.
Can you at least do double click editing of the points on the screen? If you erase a point on the screen is the coordinate file updated in real time to reflect this change?
In Point Groups, you can delete points from a group, but that does nor delete it from the source file. As far as I know you cannot edit point attributes in point groups.
This issue is a "war stopper" for a surveyor. It appears that at some point the need for coordinate values goes away? So, you take my site survey and add your design details without worrying about coordinates, then do like Architects love to do, rotate everything to "look good' on the sheet and then hand the design to me and say, "Lay this out on the ground". The coordinate file no longer matches drawing details and they have erased my control points that I had shown in the drawing because "they got in the way".  :crazy2: :idiot2: Really.
Maybe this is why so many Surveyors have switched over "to the Dark Side". A Surveyor's world is ALL about coordinates. Autodesk wants me to pay 8 Grand for software that basically ignores coordinates?
I suppose this is one of the main reasons that our engineering types load Carlson on top of AutoCAD. They are using Carlson Civil which has full coordinate control, a hefty survey portion and a robust GIS module all built in.
Title: Re: Delete Point All Groups
Post by: Dent Cermak on December 21, 2016, 09:46:10 AM
Getting back to the original question, to delete all point groups to clean up a drawing, you should be able to delete ALL groups at one time using the "Purge" command. (Or is this something else Autodesk has done away with? It HAS been awhile since I played with AutoCAD,)