Author Topic: Feature line com method  (Read 1446 times)

0 Members and 1 Guest are viewing this topic.

sdunn

  • Newt
  • Posts: 90
Feature line com method
« on: May 16, 2016, 01:07:35 PM »
I am using Civil 3d2015 and need to calculate the location of a point on a featureline so that I can add an elevation point.  I found the COM Get2dDistanceAtPoint() function, but I am having trouble getting it to work. 

Function Get2dDistanceAtPoint(varPoint As Object) As Double
     Member of Autodesk.AECC.Interop.Land.IAeccLandFeatureLine

I have tried passing it a 2d and 3d point with no success.  Does anyone know what this is looking for and more importantly, how do you go about finding what is needed if a function or method does not use a specific type?

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Feature line com method
« Reply #1 on: May 16, 2016, 01:45:13 PM »
Most all C3D COM methods/properties use an array of doubles, cast as an object, when a 2d or 3d point is needed, so that wold be the first thing I'd try.

sdunn

  • Newt
  • Posts: 90
Re: Feature line com method
« Reply #2 on: May 16, 2016, 06:14:07 PM »
Thank you for the information Jeff.

The format below is not working.  Am I creating the array incorrectly?
   
Code: [Select]
                                        Dim pt1 As Double() = {5000.0, 5000.0}
                                        Dim pt1obj As Object = pt1
                                        Dim LineSta As Double = ofeatline.Get2dDistanceAtPoint(pt1obj)

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Feature line com method
« Reply #3 on: May 16, 2016, 06:18:32 PM »
It probably is expecting a z value as well. Another way would be to just take your Point3d (assuming you already have this form a GetPoint or some other method) and use the ToArray() method.

sdunn

  • Newt
  • Posts: 90
Re: Feature line com method
« Reply #4 on: May 16, 2016, 06:28:18 PM »
Jeff,

That did it.  Is this documented somewhere or is there other way to determine what a function/method is looking for?

thank you again!

Stacy