https://chat.openai.com/chat
Here is a sample module for drawing a box with dimensions of 100mm by 400mm in CorelDRAW:
Sub DrawBox() 'Declare variables Dim boxHeight As Double Dim boxWidth As Double 'Set the height and width of the box boxHeight = 100 boxWidth = 400 'Create a new document Dim doc As Document Set doc = Application.CreateDocument 'Activate the document doc.Activate 'Turn off the snap to grid feature Application.SnapToGrid = False 'Turn off the snap to guides feature Application.SnapToGuides = False 'Turn off the snap to shapes feature Application.SnapToShapes = False 'Turn off the snap to points feature Application.SnapToPoints = False 'Turn off the snap to intersections feature Application.SnapToIntersections = False 'Turn off the snap to smart guides feature Application.SnapToSmartGuides = False 'Create a new rectangle Dim rect As Shape Set rect = doc.ActivePage.CreateRectangle(0, 0, boxWidth, boxHeight) 'Set the outline color to black rect.Outline.Color.RGB = RGB(0, 0, 0) 'Set the outline width to 0.25mm rect.Outline.Width = 0.25 'Set the fill color to white rect.Fill.Color.RGB = RGB(255, 255, 255) 'Deselect the rectangle rect.Deselect End Sub
Did it work? I tried two simple tasks and neither worked. Not sure if it understands the differences between versions, I did specify 2018.
Not at the computer this week.
I did try a drupal request for a skeleton module and that came up with something that looked credible.
Likely a better test would be something complex in excel. SQL might be a good test too.
I can't get that code to run in CorelDRAW 2017 so I ran your prompt and oddly enough, it gave me a very short bit of code that did work..
Sub DrawBox()Dim objRectangle As ShapeSet objRectangle = ActiveLayer.CreateRectangle(100, 100, 100 + 400, 100 + 100)End Sub
Gezz I hate website that don't follow standards LIKE THIS ONE.
Just wrote a long reply then thought I'd check what I was saying and control clicked my link at the top for a new tab and lost the page.
There's a bit to say here but I'm not up for typing it again tonight.
Short version is ask it to write code that could be done in more that one way, If/else or for as example.
I suspect the better the pseudo code you input the better the output.
Unfortunately, as a language model, I am not able to create macros for specific software programs. However, I can provide you with some general information on how you might go about creating a macro in Corel Draw to select square boxes with a specific RGB color.
Please note that the above instructions are just an example and you may need to adjust them according to your specific requirements.