I have a cut/fill volume surface with 2 ranges that leave a gap of 4 feet. I would like to select all tree blocks that are within the two ranges. Is this possible? Thanks,
Solved! Go to Solution.
Solved by tcorey. Go to Solution.
Do the tree blocks have elevations?
Be patient. I might be able to have something for you by this afternoon....assuming the phone doesn't ring off the hook between now and then!
That was easier than I thought. Here's some LISP code that does what you're asking for:
;Select blocks within existing surface elevation analysis ranges ;copyright 2014, Timothy Corey ;Delta Engineering Systems ;Autodesk Authorized Value-Added Reseller ;Redding, CA ;permission is hereby granted to use this code for free. ;This code may not be sold or included in any for-sale software ;It is the responsibility of any person using this code ;to evaluate and test to be sure the code works for your needs. ;the program requests you select a representative block. All blocks of that name are added to a selection set. ;A surface selection is then requested. ;The program then creates a selection set of all blocks of the correct name and that fall within the ;elevation ranges of the elevation analysis applied to the surface. ;To use the selection set, select Previous. (defun c:go ( / reptree blknam trees treesx surf **** zanal xreg cnt ctr itm minz maxz ctr1 len ob obz) (vl-load-com) (setq reptree (car (entsel "\nSelect representative tree block: "))) (setq blknam (cdr (assoc 2 (entget reptree)))) (setq trees (ssget "x" (list (cons 2 blknam)))) (setq treesx (ssadd)) (setq surf (vlax-ename->vla-object (car (entsel "\nSelect Surface: "))) **** (vlax-get-property surf 'SurfaceAnalysis) zanal (vlax-get-property **** 'ElevationAnalysis) zreg (vlax-get-property zanal 'ElevationRegions) cnt (vlax-get-property zreg 'Count) ctr 0) (while (< ctr cnt) (setq itm (vlax-get-property zreg 'item ctr)) (setq minz (vlax-get-property itm 'MinimumElevation) maxz (vlax-get-property itm 'MaximumElevation) ) (setq ctr1 0 len (sslength trees) ) (while (< ctr1 len) (setq ob (ssname trees ctr1)) (setq obz (cadddr (assoc 10 (entget ob)))) (if (and (<= obz maxz)(>= obz minz)) (ssadd ob treesx) ) (setq ctr1 (1+ ctr1)) ) (setq ctr (1+ ctr)) ) (vl-cmdf "Select" treesx "") (princ) );end defun
Best regards,
Tim
Not that a lisp to automate this would not be better but I would bet a map query could do this.
I also think it could be as easy as going into a Front (or Back or Right or Left) view, draw a pline at the top and bottom of the elv range and simply select everyting in those ranges with a crossing window using the plines as a guide.
John Mayo
In my code, the auto-censor that Autodesk uses changed the variable I used that is short for Analysis. Unfortunately, I used the first four letters of that word and it got zapped for being potentially pornographic. Sorry about that.
Anywhere you see ****, just put in whatever you want, but be sure to use the same in all of those locations. If you want to go back to the first four letters of Analysis, that was what I originally used. Innocent mistake, sorry.
Good thing this is not a proctologists discussion group. They wouldn't be able to get anything done! 😉
Tim
It was a great effort, but it didnt work. After trying it I realized my tree block is at the actual point elevation and my cut/fill surface is the difference between FG and EG.
I beleive you can accomplish this using the FILTER command. Add block name, and 2 elevation filters using <= or >= and the elevations of your blocks for each range. See attached image an an example. If your not familiar with the filter command Autocad help has some good info. Not as elegant as a lisp though...
Gunnar
That did the trick! Thanks for the lisp and the direction to the blocks to surface command. Hadnt seen that one before.