Author Topic: Delete Point All Groups  (Read 7972 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Delete Point All Groups
« 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?
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Delete Point All Groups
« Reply #1 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.  
« Last Edit: September 21, 2016, 10:37:29 AM by Jeff_M »

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Delete Point All Groups
« Reply #2 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.
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Delete Point All Groups
« Reply #3 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
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Delete Point All Groups
« Reply #4 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.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Delete Point All Groups
« Reply #5 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.
Civil3D 2020

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Delete Point All Groups
« Reply #6 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?

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Delete Point All Groups
« Reply #7 on: September 23, 2016, 07:50:34 AM »
Works with Civil3D 2016 and 2017.
Civil3D 2020

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Delete Point All Groups
« Reply #8 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.

Dent Cermak

  • Guest
Re: Delete Point All Groups
« Reply #9 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.


Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Delete Point All Groups
« Reply #10 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.

Dent Cermak

  • Guest
Re: Delete Point All Groups
« Reply #11 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:

BlackBox

  • King Gator
  • Posts: 3770
Re: Delete Point All Groups
« Reply #12 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
"How we think determines what we do, and what we do determines what we get."

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Delete Point All Groups
« Reply #13 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?
Civil3D 2020

BlackBox

  • King Gator
  • Posts: 3770
Re: Delete Point All Groups
« Reply #14 on: December 17, 2016, 10:46:00 PM »
Haha - Geopack or InRoads?
"How we think determines what we do, and what we do determines what we get."