Hello,Why code below return always "Bounding box is not empty" ?
Private Sub CommandButton23_Click()'activeShape.BoundingBox.is'Sub BoundingBoxExample() ' Create a new shape (e.g., rectangle) Dim myShape As shape Set myShape = ActiveLayer.CreateRectangle(2, 1, 5, 5) ' Get the bounding box of the shape 'Dim myBoundingBox As ShapeRange Set myBoundingBox = myShape.BoundingBox ' Check if the bounding box is empty If myBoundingBox.IsEmpty Then MsgBox "Bounding box is empty." Else MsgBox "Bounding box is not empty." End If ' Delete the shape (optional) myShape.Delete'End Sub
End Sub
What to do to return "Bounding box is empty."
Code is started when new file is created, with no other shapes on it
Greetings!
For a Rect structure to be considered empty it must have its height and width equal to zero, no created figure will provide you with an empty one, if you need an empty Rect, you can create an orphaned Rect with the "CreateRect" method https :/ /community.coreldraw.com/sdk/api/draw/18/m/application.createrect?lang=vba
Hello,Thank you very much for this answer. Maybe I'm asking my question wrong. Now I will explain. I'm looking for a way after I select an ellipse and run a macro to add all the shapes that are inside the ellipse to the selection. I can then easily move the selected shapes while they stay in their layers.This is a preparatory stage for a macro that will arrange many repeating ellipses with some repeating shapes inside. The ellipses are in the CUT layer and the shapes inside are in the EDIT layer. This is preparation for cutting on a cutting plotter.The issue is important to me as I have hundreds of hand made circular label files and now I need to change the spacing between them. Accordingly, each label consists of an ellipse for cutting and an inner part for printing.Open in Google TranslateI would appreciate any advice on this problem.Greetings!
Take a look at "Axis Aligned Bounding Box" and "Separating Axis Theorem", maybe in your case it will solve it, these subjects include an introduction to computer graphics and also game development.I tried to upload an image I drew with some formulas but it's giving me an error,
It seems you need the function I used in the video herehttps://youtu.be/BctcTTSJ-NE
Thank You!