Unable to find Interop.Common.AcadEntity in BricsCAD assemblies
Hello,
Recently, our management take the decision to move from AutoCAD to BricsCAD as a main application for creation of workshop drawings. Since we have relatively large .NET code base for AutoCAD extensions, we would like to move this extensions to BricsCAD. Initially, just to proof the concept, I compiled a single dll file, that could be "netloaded" into Acad or Bcad and it works great!
Later, when I started to migrate our code, I found that there are tiny differences between 2 APIs. Par example:
[code]Application.DocumentManager.Open()[/code] is not available as a method of BricsCAD DocumentCollectionClass calss.
As a workaround I used a code, taken from this forum:
[code]
var app = Application.AcadApplication as AcadApplication;
var doc = app.Documents.Open(path, false, null);
if (doc != null)
{
app.ActiveDocument = doc;
} [/code]
Currently I can't move on, because I couldn't find anything about:
[code]Autodesk.AutoCAD.Interop.Common.AcadRegion acadRegion = (Autodesk.AutoCAD.Interop.Common.AcadRegion)region.AcadObject;[/code]
[code]
PrincipalDirections = (double[])acadRegion.PrincipalDirections;
PrincipalMoments = (double[])acadRegion.PrincipalMoments;
MomentOfInertia = (double[])acadRegion.MomentOfInertia;
ProductOfInertia = acadRegion.ProductOfInertia;
RadiiOfGyration = (double[])acadRegion.RadiiOfGyration;
[/code]
Those classes just don't exist in BricsCAD assemblies
Could you, please, help me!
Best regards!
Angel
0
Comments
-
Some of them are different/don't exist, maybe these older posts will help you...
https://forum.bricsys.com/discussion/24986
https://forum.bricsys.com/discussion/24006
Full disclosure: while these techniques still work, the API mentioned in those is from Bricscad v14. There may(likely) be API changes in v16.0 -
Thank you, very much, Chris!I've already read those threads and started to write shimming codehttp://www.bricsys.com/bricscad/help/en_US/V16/DevRef/ and .NET Reflector, they helped a lot.It seems that the code of my autocad extension apps is written for ACAD 2010 - 2013 and area characteristics are not accessible through .net api back then. That's why interop is used. I'm looking at 2016 and those characteristics are now available for .net.Bricscad contains Solid3d.MassProperties property which solves my issueBest regards, Angel!0
This discussion has been closed.