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

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Water Moccasin
  • Posts: 1866
  • 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?
Autodesk Infrastructure Design Suite 2016

Jeff_M

  • King Gator
  • Posts: 3875
  • 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.       (strcat "AeccXUiLand.AeccApplication." C3D)
  19.     )
  20.   )
  21.   (setq C3Ddoc (vla-get-activedocument C3D))
  22.   (setq groups (vlax-get C3Ddoc 'pointgroups));;this line was omitted
  23.      )
  24.    (progn
  25.      (vlax-for grp groups
  26. (if (wcmatch (vlax-get grp 'name) "*.#,*.##")
  27.  (setq groupstoremove (cons grp groupstoremove))
  28. )
  29.      )
  30.      (if groupstoremove
  31. (foreach grp groupstoremove
  32.  (vlax-invoke groups 'remove grp)
  33. )
  34.      )
  35.      (vlax-release-object C3D)
  36.    )
  37.  )
  38.  (princ)
  39. )
  40.  
« Last Edit: September 21, 2016, 10:37:29 am by Jeff_M »

MSTG007

  • Water Moccasin
  • Posts: 1866
  • 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.
Autodesk Infrastructure Design Suite 2016

MSTG007

  • Water Moccasin
  • Posts: 1866
  • 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
Autodesk Infrastructure Design Suite 2016

Jeff_M

  • King Gator
  • Posts: 3875
  • 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

  • Water Moccasin
  • Posts: 1866
  • 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.
Autodesk Infrastructure Design Suite 2016

Area51Visitor

  • Swamp Rat
  • Posts: 567
  • Mars sucks!
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?
- Area51Visitor

MSTG007

  • Water Moccasin
  • Posts: 1866
  • 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.
Autodesk Infrastructure Design Suite 2016

Jeff_M

  • King Gator
  • Posts: 3875
  • 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

  • Needs a day job
  • Posts: 6902
  • Clinton, Mississippi
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.

If you are looking to me for answers, you really have problems. Carlson Survey 2016 w/ Embedded AutoCad

Jeff_M

  • King Gator
  • Posts: 3875
  • 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

  • Needs a day job
  • Posts: 6902
  • Clinton, Mississippi
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:
If you are looking to me for answers, you really have problems. Carlson Survey 2016 w/ Embedded AutoCad

BlackBox

  • King Gator
  • Posts: 3736
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
"Potential has a shelf life." - Margaret Atwood

MSTG007

  • Water Moccasin
  • Posts: 1866
  • 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?
Autodesk Infrastructure Design Suite 2016

BlackBox

  • King Gator
  • Posts: 3736
Re: Delete Point All Groups
« Reply #14 on: December 17, 2016, 10:46:00 pm »
Haha - Geopack or InRoads?
"Potential has a shelf life." - Margaret Atwood