How to read from Properties - Geometry - Measurements - Area

Hi everybody,

can you please help me? I'm trying to write macro for trimming two surfaces to each other
where the surface is split to two parts in intersection of two surfaces. My idea was to read area value for both parts and delete the smaller one. How ever I'm unable to find way how to get object area properties. Can anyone help me?
(by the way is there some list of all VBA properties which are accessible by VBA?)

Thanks for the answer

Comments

  • I don't know anything about macros, and I don't know of a comprehensive list of available VBA properties, but the custom command in the attached lisp file gives a list of all the VBA Properties and Methods of a selected entity.
  • To access the internal structure of solids, regions and surfaces, there is a special API called bRep (Boundary Representation). This API allows, for example, to enumerate all the surfaces of a solid and examine their properties such as area. But this API is only available in .Net and ARX|BRX. I strongly doubt that it is available for VBA. I would advise you to move to .Net. It has its own Basic, but of course C# is much more convenient.
  • Anthony thanks for the DumpPM looks helpful :-) .
    AVC thanks for the reply, my programming skill are limited for now, I use VBA to interconnect excel with cad and this looks to me as the easiest method but I think VBA is obsolete.
  • ALANH
    edited March 2023
    Autodesk announced like 10 years ago that it was discontinuing VBA support in future, well its still there, are you happy to tell Mr Microsoft that they should discontinue VBA support. When Microsoft says no more then VBA will stop. The Excel market is probably way bigger than the CAD market and record macro actually works, not like the woeful Acad version.

    It is like all the CAD suppliers saying no more LISP support.

    Unfortunately programs like Lisp2C died a quite death. Way ahead of its time like 20+ years ago.

    ps do you draw objects direct from Excel you can do it just write a Line, Pline, Circle sub etc.
  • I also once started programming under AutoCAD in VBA precisely because it was easy for me to transfer the existing code from MS Access. But I quickly realized that this is a dead end direction. Very slow, very few options. And then MS forgot to recompile most of the COM components for 64-bit Windows, and as a result, my old forms all stopped working. This is where the VBA story ended for me.
    Of course programming in C# is much more complex and the API is much more complex. But you can start with other people's examples - there are a lot of them. Now I have the same C# code working in both AutoCAD and Excel. After a poor VBA code rebactor, switching to Visual Studio is like a breath of fresh air :)
  • :-) I understand AVC :-) ALANH I do with macro things which are difficult to do per hand as I draw ball trough three points in 3D and then cut it with planes going trough two points and the centre of ball and delete the excesive parts so that on the end I have only one surface which is between those three points and now I wanted do make the final view smoother to trim those surfaces to each other that there will not be any overlaps between two neighbors.