.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
i have a set of coordinates, not on the polyline. i want to find the polyline width where that coodinate intersects perpendicular to the polyline (shortest distance). without going through all the vertices.
i have a polyline with many segments with varying width, which are constant through the each segments (no taper width). need to read off the "instantaneous" width.
just 2dpoly or lwpoly not 3d.
i found this
not quite what i want.
thanks
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011
Solved! Go to Solution.
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
i thought about going through the polyline vertices one at a time and then take my point and calculate distance. find the shortest distance from that and then record the index where that happens.
but i am afraid it may slow down my program. i have 1000 of these to run and if it goes through 1000 vertices could be slow. but i am gonna try it with my way first and hopefully someone has a better way.
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
A polyline derives froma Curve, so it inherits the GetClosestPointTo() method. With the point you can get the parameter at the point which you can then use to GetStartWidthAt()
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
thanks jeff very helpful. not figured out yet but getting there.
where is the help file for all these rare functions? i think there is none. like roughly explains what the arguments you need to feed it do.
not just for this but generally for everything.
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
how do you get closest index giving a point?
doesn't have a "GetIndexAt" function
the getparameteratpoint returns a double? what is it which parameter does it return?
i need to get the index without going through the vertices as this will slow down my subassembly.
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
wang890 wrote:
the getparameteratpoint returns a double? what is it which parameter does it return?
For Polyline parameter is number of vertex. For example parameter == 1 means second vertex, parameter = 2.5 means middle between third and fourth vertex.
What are AcDbCurve/Curve Parameters? ObjectARX/.NET
Getting the Midpoint of each Polyline Segment using ObjectARX
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
seen.
i am off testing this now.
2.6 of a vertex lol.
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
works, here's the code
Dim oEmbankmentTypeTarget As WidthOffsetTarget
Try
oEmbankmentTypeTarget = oParamsOffsetTarget.Value("TargetHA1")
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Using lock As DocumentLock = acDoc.LockDocument
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
'' Open the Block table for read
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
'' Open the Block table record Model space for write
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = CType(acTrans.GetObject(acBlkTbl(BlockTableRecord. ModelSpace), _
OpenMode.ForWrite), BlockTableRecord)
Dim obj As DBObject = acTrans.GetObject(oEmbankmentTypeTarget.TargetId, OpenMode.ForWrite)
If TypeOf obj Is Polyline Then
Dim oPoly2dOrig As Polyline = CType(obj, Polyline)
'get the index where the current station is closest to
Dim x, y, z As Double
corridorState.SoeToXyz(corridorState.CurrentAlignm entId, corridorState.CurrentStation, 0, 0, x, y, z)
Dim oPt3D_CL As New Point3d(x, y, z)
'get vertex index (fraction)
Dim dVertex As Double = oPoly2dOrig.GetParameterAtPoint(oPoly2dOrig.GetClo sestPointTo(oPt3D_CL, True))
'get polyline width
dSegmentWidth = oPoly2dOrig.GetStartWidthAt(Truncate(dVertex))
End If
End Using
End Using
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: given coordinate , find polyline width at that segment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
no, have to round down.
say point 0 to 10 is 0.5m wide, 10-20 is 1.0m wide. when hit 9.99 say it is still within the 0.5m geotechnical zone.
don't worry i am all good.
cheers mate.
Work: Xeon W3503, 12GB, Quadro 2000, Dell 19' x 2
Home: 3930k, 16GB, GTX 590, Dell U3011



