I need a help with Autocad 2012 with VBA (Visual Basic for Application),
I want to measure some solid objects volumes (3D).
All my objects were put different layers. Every layers have got one object.
Which classes should I use?
Thanks for helps....
Solved! Go to Solution.
>> Which classes should I use?
Do you mean "which references"? Then the default references for AutoCAD that are already referenced when you start a new VBA-project.
Public Sub ScanForSolids_Output_Volume() Dim tEnt As AcadEntity For Each tEnt In ThisDrawing.ModelSpace If TypeOf tEnt Is Acad3DSolid Then Dim tEntSolid As Acad3DSolid Set tEntSolid = tEnt ThisDrawing.Utility.Prompt (vbCrLf & "SOLID: handle: &h" & tEntSolid.Handle & " / volume: " & tEntSolid.Volume) End If Next End Sub
BTW: there is a special forum for >>>VBA with AutoCAD<<<
- alfred -
Thanks for helps.
I wrote you codes, it is working very well.
Bu t I wanna sequence my solid objects in descending order from big to small.
Has Acad3DSolid got any class that I can use in descending order?
thanks for helps..
Sorry, I overlooked this thread, so my answer is real late.
>> Has Acad3DSolid got any class that I can use in descending order?
Acad3DSolid is no object that has any sortling capabilities (as it can't hold list of <anything>).
So it's up to you to put them do a collection/list/.... and sort by yourself.
- alfred -
Many many thanks for helps..
But I wonder Where can I learn AcadSolids references?
I am a .NET user. While you are working with C sharp, If you get mouse icon on any program code (objects), you can see all references about it.
As far as I'm concerned Acadsolid is hidden box or close box forme. Where can I learn this object's references?
Thanks for helping,,
I'm not sure to understand your question "Where can I learn AcadSolids references?" really.
Anyway: please see the difference between "AcadSolid" and "Acad3DSolid", that are totally different things!
- alfred -
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.