Monday 13 December 2010

A little LSP selection Gem for Civil3d that keeps on giving

I wrote this little bit of lsp code way back in 2008 for the quick and easy selection of civil3d objects, before the “Select Similar” and “Select Object” functionality was introduced to Civil3d under right click on the shortcut menu in drawing space and prospector. 
However these commands have not made this code redundant, it just seems it keeps on giving time and sums up my core philosophy to using Autocad and Civil3d. If I can, I will find a quicker way.
Basically the code was born back in the day thru the frustration of having to use the “qselect” to find those pesky little diamond grading object markers in a drawing and the amount of time and clicks that it took to rebuild the same selectionset over and over again to find the little things and check if you were in the drawing or the grading in the drawing was corrupt.
Here are examples of the commands I use most frequently and how I use them in my workflow to save time.
  1. SelectGrading = SG , Type SG finds all the grading objects in a drawing. Right Click select Object View and there’s my model
  2. SelectFeaturelines = SF, Type SF and find and select all featurelines
  3. SelectAlignments =SA, Type SA select all alignments, Bring Alignments to the front, Make all Alignment Styles the same by pressing Ctrl+1 and changing the style in the property windows.
One advantage of this routine has over Select Similar is all similar Civil3d Objects in a drawing are selected even if the object styles are different. Unable to display content. Adobe Flash is required.
The code consists of 10 simple lines of code as follows:-
;************************************************************************************* ;this routine selects all the alignment objects is a drawing ;saves having to use the qselect command and clicking three or four times
(defun C:SELALIGNMENT () (ssget "_X" '((0 . "AECC_ALIGNMENT"))) (setq sset (ssget "P"))   (if sset     (progn       (sssetfirst sset sset)       ;(command "_.PROPERTIES")     )   ) ) (defun c:SA () (C:SELALIGNMENT))
;************************************************************************************** You can create more Civil3d and Autocad object selection commands by copying the block of code above and say if you were wanting to select Parcels select a parcel in a drawing and list it image  In the first line of the list you get the object type “AECC_PAREL” swap this for “AECC_ALIGNMENT” in the code block also change the SELALIGNMENT to say SELPARCEL and SA to SP. You can download the lsp file AH-Selectgrading.lsp I use here if you wish there are a few other routines included that you can delete out of the file if unwanted. https://sites.google.com/site/c3dxtreme/
If you guys like this sort of stuff leave I comment. If not tell me what you wish to know more about or what Civil3d should do you never know I may have been there and done it before.

1 comment:

  1. Thanks for the tips on creating the lsp for these selections. These kind of timesavers are great!

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...