![]() |
【转帖】converting oddb objects to odge objects
converting oddb objects to odge objects
converting oddb objects to odge objects hi i am a bit new to dwgdirect programming and have a question. it seems to have been asked a couple of times in various ways in both this forum and the autodesk forum. but i can't seem to find a real answer. sorry if i am repeating something that has been answered already. the use case is this: i have a dwg drawing that i want to read and check that various rules have been followed in it's construction (e.g. circles are no more that 5 inches in diameter, they are not closer that 10 feet apart, etc). the odge library seems perfect for these type of geometric calculations, but the objects are in oddb form. 1. is there a way to convert between the two libraries (casting operator or conversion function) ? 2. if yes, are there any side effects i should be aware of ? 3. if no, how should i solve this problem ? thanks, todd k. hi todd, 1) as i know there is no direct way to do such conversion. 2) no side effects because you don't have it 3) there can be different ways to solve it depending on what you need. do need a kind of virtual function getasgeentity and it returns odgeentity3d* as a result? or you simply need to convert several base classes like oddbline, oddbcircle or oddbarc to their geometrical analogues and use for example a switch() statement rather than some complex virtual mechanism? best regards chudomir odge <-> oddb for oddbhatch loops ? hi everybody, i am looking too for easy conversions between odge and oddb classes. in fact i would like to import the oddbhatches loops as oddbcurve and not as odgecurve2d. i would like to avoid rewriting the code that parse oddbcurve for odgecurve. have you got a solution ? thank you in advance. last edited by jerome roche; 11th january 2008 at 02:25 amfff">. no answer ? is there anyone here ? hi jerome, i think there is no direct conversion to extract the hatch loops. a hatch loop can be of a polyline type (points and bulges) and in that case it can be easily converted to oddbpolyline object. but when the loop consist of odge curves, then you should create either separate oddbcurve for each item, or one oddbregion composed by the smaller curves (they can be type of line, arc, spline or elliptical arc). best regards chudomir best regards chudomir thank you for your answer. |
所有的时间均为北京时间。 现在的时间是 06:52 PM. |