Trying to convert from ACAD to BricksCAD

Hello
We have an application we developed for AutoCAD but want to go over to BricksCAD. It's done in C++ and most of it works, but there are some erros that I try to figure out. For example this piece of code:

AcDbRegion test_reg = (AcDbRegion)regionArr.at(0);
insertEntity(test_reg);
test_reg->setLayer(LAYERSTR_SWEEP);
test_reg->close();

test_reg->getPlane(plane);
plane.getCoordSystem(origin, xAxis, yAxis); // origin coordinates are different in ACAD compared to BricksCAD

At first I have a region from an array and the first lines are just to draw out the shape as a debug. The shape is exactly the same in ACAD and BricksCAD but the last lines that tries to get the origin from it behaved different. Maybe the "getCoordSystem" doesn't work in BricksCAD?

I have checked everything before this. Coordinates of the region and so on and made sure they are all the same on both version. It's just the lastlines that get the origin that behaves differently.

Comments

  • Dear Samuel,

    maybe, you could add a SupportRequest, and add such a dwg file (containign such a region), with this small code snippet ?
    We might investigate why the region reports different parametrics, compared to AutoCAD/ARX ...
    many greetings !

  • What is the origin based on? Since a plane doesn't have a certain origin it could be anything. It seems like BricksCAD uses the first vertex in the region for the origin, which might be fine, but in ACAD it's something different.

    I'm not sure it is the origin that gives us poroblems since I tried to force it to 0,0,0 in both ACAD and bricksCAD but it didn't solve the problem. The part after the origin is a "getAreaProp(" command and it needs the origin as a parameters. Maybe it is getAreaProp that doesn't work correctly or the same way as in ACAD.

  • Dear Samuel,

    yes, the origin should not matter at all - as it is the origin of the plane, not the "origin of the region" :smile:
    If you could provide a code snippet where you get different results under BC/BRX compared to AC/ARX, and a sample dwg with such a region, will will be glad to investigate, in order to detect & fix any potential incompatibility ...

    So indeed best to provide this as a SupportRequest.
    many greetings !

  • Were should I mail it? I am busy with other things for a couple of weeks but can do it after that.

  • It is on the BricsCAD/Bricsys web site :
    https://www.bricsys.com/protected/support/NewSupportRequest.do

    Probably it will require your user login ...
    many greetings !

  • I think I have narrowed it down to be the "intersectWith" function in regions. Atleast I have one situation with two regions that overlap and intersect 6 times (according to ACAD) and I get 0 intersections from BricsCAD with the same code. I made a test that when I get 0 intersections I draw the two regions and they are correct. Visually I can see they intersect 6 times, but the "intersectWith" function says 0.

  • I made a test so that if intersections = 0 then I draw the two regions so I could see what it going on. The drawings are correct and it is easy to see that the two regions are intersecting each other. However, one region is made of two parts. I wonder if that is the problem. If BricksCAD intersectWith command has a bug so that it won't calculate this corrent. The regions are as on my image here. One is white and one is yellow. It's easy to see that they do intersect 6 times as ACAD reports.