First, in reading previous posts, I assume nobody has been able to create a parametric part used for storm pipe networks that can have the pipes attached to a point within the structure other than the insertion, or have the elevation read from a point other than the insertion.
With that in mind, we are trying to develop a tool that would allow us to pick a strucutre, and set its "rim" elevation to a point on a proposed surface that is not at the insertion of the strucure. I am decent with lisp, but have not attempted to gather info from random points on civil ojects. Any help would be greatly appreciated.
Thanks
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Sketch attached... let me know if that doesn't clarify...
Thanks
Hi Andrew,
I am not sure of what help you need here.
Do you want to confirm if there is a way to >>> pick a strucutre, and set its "rim" elevation to a point on a proposed surface that is not at the insertion of the strucure.<<<
If so, yes, using API we can do this.
.NET API -
Structure.RimElevation -> Gets or sets the rim elevation.
Structure.Location Property -> Gets or sets the location.
COM API -
IAeccStructure:: RimElevation Property ->Gets or sets the rim elevation.
IAeccStructure:: SetLocation
If I am missing anypoint here to understand the question, please elaborate w.r.t the PDF you attached here.
Thanks,
Partha
OK, that seems like the door would be open to do what I am trying to do. I do not know how to use either of those code formats, though. Is there documentation on how/where to apply those? Also, how would I retrieve a surface elevation at a selected point to apply using the "structure.rimelevation" variable?
Thanks for your help!
Some things that come to mind about this. You would need to insure that the structure is always rotatated exactly where that point is on the lip of gutter, does the structure size ever change? If so, how does it affect the center to edge relationship?
Is the difference from the actual insertion to the lip of gutter a constant value? Could the builtin Surface Adjustment Value be used instead of custom programming?
We typically do insure that the structure alignment is such that it is on the curb. You make a good point about edge/insertion relationship, because it does change for different structures. This is in part why we have been reluctant to use the Surface Adjustment Value, because in some cases, the vertical relationship of the center structure to the surface elevation at the lip of the gutter is not the same. For example, some jurisdictions require a 2% slope up from the curb, while others may require a 2% slope down. Sometimes there is a 6" vertical curb, sometimes there is a 4" mountable curb. So the math and number of potential permutations starts to become very complex to account for all these potential scenarios.
Hence, the idea to just have a command that will allow you to pick the structure, and assign the rim based on a point that is selected within the desired surface. Make sense?
And he makes it sound so easy......
Yes, that is exactly it.That would be wonderful!
Here's a quick working example, Andrew.
;;example of one way to set the rim elevation based on a user specified point on a surface. ;; Should have error checking, perhaps a cleaner selection process, etc. ;; The intent for this is for it to be used as an example, not necessarily a fully functional routine. ;; Sept 5, 2013, by Jeff Mishler (defun c:setrimelevationfromsurface (/ ss surf struc elev pt) (vl-load-com) (while (and (princ "\nSelect structure: ") (setq ss (ssget ":S" '((0 . "AECC_STRUCTURE")))) (setq pt (getpoint "\nPick Rim location: ")) ) (setq struc (vlax-ename->vla-object (ssname ss 0)) surf (vlax-get struc 'surface) ) ;;if the structure does not have a reference surface we need to get one from the user (if (not surf) (progn (princ "\nStructure does not reference a surface, please select one: ") ;;should make this more foolproof, bad things will happen if no surface selected (setq ss (ssget ":S" '((0 . "AECC_*Surface"))) surf (vlax-ename->vla-object (ssname ss 0)) ) ) ) ;;this will fail if not on surface (setq elev (vlax-invoke surf 'findelevationatxy (car pt) (cadr pt))) ;;make sure the referenced surface does not adjust the rim (vlax-put struc 'AutomaticRimSurfaceAdjustment 0) ;;set the rim elevation (vlax-put struc 'rimelevation elev) (princ (strcat " ... rim elevation set to: " (rtos elev))) ) (princ) )
Works like a champ..... The only other thing I would change (if I had the knowhow) would be to select the surface I want to set the structures to first. It seems that the functionality (if I am reading/running it correctly) is that it defaults to setting the elevation based on the surface that is associated with the structure, and then it invites you to pick a surface if there isn't one assigned. So, if the flow were: Pick Surface, pick structure, pick point, pick structure, pick point, pick structure, pick point..... Wouldn’t that alleviate the case of "structure doesn't have a surface associated with it?
Thanks again for all your help! This is light-years ahead of where I would have gotten on my own.
OK, Andrew, here's a revised version based on your suggested work flow. Must select a surface first then that surface will be used for all elevations. Will still fail if the user picks a point not on the surface.
;;example of one way to set the rim elevation based on a user specified point on a surface. ;; Should have error checking, perhaps a cleaner selection process, etc. ;; The intent for this is for it to be used as an example, not necessarily a fully functional routine. ;; version 2, Sept 25, 2013, by Jeff Mishler (defun c:setrimelevationfromsurface (/ ss surf struc elev pt) (vl-load-com) (princ "\nSelect a reference surface: ") ;;should make this more foolproof, bad things will happen if no surface selected (if (setq ss (ssget ":S" '((0 . "AECC_*Surface")))) (progn (setq surf (vlax-ename->vla-object (ssname ss 0))) (while (and (princ "\nSelect structure: ") (setq ss (ssget ":S" '((0 . "AECC_STRUCTURE")))) (setq pt (getpoint "\nPick Rim location: ")) ) (setq struc (vlax-ename->vla-object (ssname ss 0))) ;;this will fail if not on surface (setq elev (vlax-invoke surf 'findelevationatxy (car pt) (cadr pt)) ) ;;make sure the referenced surface does not adjust the rim (vlax-put struc 'AutomaticRimSurfaceAdjustment 0) ;;set the rim elevation (vlax-put struc 'rimelevation elev) (princ (strcat " ... rim elevation set to: " (rtos elev))) ) ) ) (princ) )
Hey, man, thanks a million!