Author Topic: Civil 3d View Frame (or rectangular polyline)  (Read 2713 times)

0 Members and 1 Guest are viewing this topic.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Civil 3d View Frame (or rectangular polyline)
« on: June 18, 2016, 11:38:02 PM »
How can I get the angle of a rectangular polyline along the longer line?
« Last Edit: June 18, 2016, 11:41:07 PM by Area51Visitor »

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #1 on: June 19, 2016, 12:06:26 AM »
Nevermind peeps...just use Math.Max(Math.Max(Math.Max))) to get the longer segment.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2139
  • class keyThumper<T>:ILazy<T>
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #2 on: June 19, 2016, 12:24:16 AM »

What are you applying the Math.Max to ??

I don't use Civil3D and I didn't notice a Rectangle Class that has the side lengths as properties.

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #3 on: June 19, 2016, 02:17:20 PM »

What are you applying the Math.Max to ??

I don't use Civil3D and I didn't notice a Rectangle Class that has the side lengths as properties.

Was for the line segment with the longer length.  Exploded the polyline down to line segments to get their lengths and used the example here: http://stackoverflow.com/questions/6800838/in-c-sharp-is-there-a-method-to-find-the-max-of-3-numbers

The longer line I used as my objectId to get the angle I wanted

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #4 on: June 20, 2016, 09:28:53 AM »
I cycle through the points finding the longest length, then use the angle property of the vector of those 2 pts. Gets a little trickier w/ 3d

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #5 on: June 20, 2016, 10:07:30 PM »
ha...ya... I was being pretty lazy.

Line.Angle lol

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2139
  • class keyThumper<T>:ILazy<T>
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #6 on: June 20, 2016, 11:28:18 PM »

Some people would check if it is actually a rectangle :
4 sides,
4 corners, diagonals equal ....


sidetrack :
does the Line.Angle return the angle relative to WCS UCS ECS DCS PSDCS ??

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Civil 3d View Frame (or rectangular polyline)
« Reply #7 on: June 21, 2016, 01:32:57 AM »

Some people would check if it is actually a rectangle :
4 sides,
4 corners, diagonals equal ....


sidetrack :
does the Line.Angle return the angle relative to WCS UCS ECS DCS PSDCS ??

good point... I'm not considering anything in regards to wcs/ucs, etc... I'll need to verify it wont mess anything up. Thanks!