Good Day Dear residents and new participants of CorelDraw COMMUNITY.
I really need help with macros. And the situation is this:
I usually draw a rectangle and write their dimensions (height and width) at the bottom of the rectangle.
Since I have a large amount of work, it takes time to manually type out the dimensions of each rectangle.For this reaseon, I decided to use special macro which will automatically write the dimensions (height and width) of object.I found a macro that only shows the dimensions of a rectangle in a Message Box (MsgBox). But I don't need it.
I just want to have an inscription of the dimensions of the object below the object and that's it. I will be pleased
Can You help me with coding macro, which can write the width and height (dimensions) of selected object (even this object isn't curve, but rectangle, triangle, sircle and etc.) ?
(An approximate algorithm of what I need, I will attach below as a picture)
Sub ObjectsDimension() Dim s As Shape, s1 As Shape, SR As ShapeRange ActiveDocument.Unit = cdrCentimeter Set SR = ActiveSelectionRange For Each s In SR Set s1 = ActiveLayer.CreateArtisticText(s.LeftX, s.BottomY - 1, Round(s.SizeWidth, 2) & " * " & Round(s.SizeHeight, 2) & " (cm) ") s1.RightX = s.RightX Next sEnd Sub
Oh that's great. I checked it. This is what I needed. You are the most powerful person in the world, You are my savior. Giant thank you my friend
This works great!
I'm not a macro master by any means, but I'm trying to find the code for this that allows you to specify the font and font size that's used when creating the measurements.
Set s1 = ActiveLayer.CreateArtisticText(10, 200, "The first line of text", , , "Arial", 36) Set s1 = ActiveLayer.CreateArtisticText(10, 180, "The second line of text", , , "Bell MT", 24)
Here's a macro that I wrote to do this type of job:
#32: Macro - "Rect Area Dims".
That blog post includes a basic description of the macro, a link to a video, and a link where the .GMS file can be downloaded.