If I draw a polyline in model space and use the OFFSET command, it works just fine.
If I create an AcDb3dPolyline in code and use getOffsetCurves() - regardless of whether the object is database resident or not - I get eNotApplicable.
Why? The documentation makes no mention of returning that code, or what limitations there might be.
How can I emulate the results of OFFSET on that polyline programmatically? I need to be able to feed in distinct points forming a polygon, and get the resulting distinct points I would see if I performed the operation in model space.
(I've tried using AcGePolyline3d and getTrimmedOffset() and that does work - but then I can't get the correct resulting points out. getSamplePoints() doesn't quite get what I need, I have no clue as to how many resulting points there are, and numFitPoints() returns garbage, preumably because it doesn't consider it a 'fit' curve. If I could just get the distinct corners back out of it I'd be OK.)
Solved! Go to Solution.
Solved by maisoui. Go to Solution.
Hi,
I guess OFFSET is not applicable in 3d world. You can only use 2d objects like Ac2dPolyline or AcDbPolyline.
Regards,
You were absolutely right - it required AcDb2dPolyline. I hadn't thought of trying that. Perversely, it still requires a 3D point array... but all points have to have the same elevation. Bizarre. Since the polygon was planar anyway, even as 3D, I don't see why it couldn't have done it. Still, a result is a result - so thank you.
(Fair warning - despite the constructor to AcDb2dPolyline having false for the closed polygon flag, you *do* have to have a closed set of points for it (last point = first point), otherwise the result isn't quite right.)