Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Network Structure Elevation Change

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
b-man
958 Views, 13 Replies

Network Structure Elevation Change

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

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)
13 REPLIES 13
Message 2 of 14
Jeff_M
in reply to: b-man

Can you provide a sketch of what you want to do with the structures?

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 14
b-man
in reply to: Jeff_M

Sketch attached... let me know if that doesn't clarify...

 

Thanks

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)
Message 4 of 14
Anonymous
in reply to: b-man

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

Message 5 of 14
b-man
in reply to: Anonymous

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!

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)
Message 6 of 14
Jeff_M
in reply to: b-man

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?

Jeff_M, also a frequent Swamper
EESignature
Message 7 of 14
b-man
in reply to: Jeff_M

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?

 

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)
Message 8 of 14
Jeff_M
in reply to: b-man

Ah, so you want the user to select the point on the surface...much simpler than trying to calc the location. I'll try to piece together some sample lisp code that should be able to do this.

Jeff_M, also a frequent Swamper
EESignature
Message 9 of 14
b-man
in reply to: Jeff_M

And he makes it sound so easy......

 

Yes, that is exactly it.That would be wonderful!

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)
Message 10 of 14
Jeff_M
in reply to: b-man

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)
)

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 11 of 14
Anonymous
in reply to: Jeff_M

Hi Andrew,

 

I presume now you can move forward in implementing your code using LISP - right ?

 

Thanks,

Partha

Message 12 of 14
b-man
in reply to: Jeff_M

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.

 

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)
Message 13 of 14
Jeff_M
in reply to: b-man

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)
)

 

Jeff_M, also a frequent Swamper
EESignature
Message 14 of 14
b-man
in reply to: Jeff_M

Hey, man, thanks a million!

Andrew Martin, P.E., CFM
ESP Associates
Slave to the AutoCAD Civil 3D Machine
Civil 3D 2020
Win 7 Pro SP 1, 64-bit on HP Elitebook 8770w (8GB Ram)

"The only thing worse than training your employees and having them leave is not training them and having them stay" - Henry Ford (a fairly successful businessman)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report