ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

getOffsetCurves() & AcDb3dPolyline

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jason.teagle
1308 Views, 2 Replies

getOffsetCurves() & AcDb3dPolyline

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

 

 

 

 

2 REPLIES 2
Message 2 of 3
maisoui
in reply to: jason.teagle

Hi,

 

I guess OFFSET is not applicable in 3d world. You can only use 2d objects like Ac2dPolyline or AcDbPolyline.

 

Regards,

 

--
Jonathan
Message 3 of 3
jason.teagle
in reply to: maisoui

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

 

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

Post to forums  

Autodesk Design & Make Report

”Boost