Need advice on how to proceed

mstrick96

New Member
Joined
Apr 20, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have a project that I need some advice on how to proceed. I'm a retired engineer and an artist and this project combines the two disciplines.

It involves a composition analysis tool called Dynamic Symmetry which is used to construct an armature on the painting surface that is used to locate features on the painting. An example of a rectangle with an example armature is shown.

armature.jpg


There are a number of different ways to construct these armatures. This is only one.

What I would like to do is to use Excel to calculate and draw the rectangle with the armature. I would like to be able to produce this drawing as shown or, optionally, over a photograph of a painting to be analyzed.

I can manually draw the armatures using GIMP or Photoshop but would like an easier way to do it. Using GIMP, etc, separate armatures need to be drawn for each aspect ratio rectangle.

I would like to enter the length and width of the rectangle so that the armature can be scaled to the correct aspect ratio. I can calculate the endpoints of each line of the armature and know how to do that.

My question is What are some ways to drawing the resulting figure? Can this type of drawing be done in Excel, perhaps using VBA?

Any guidance will be appreciated!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
The best way to do it is to use a graph and Trigonometry. This web page from Microsoft can get you started. It is for 3D graphics but might get you on the right track.
 
Upvote 0
You could create that in excel and could control the aspect ratio but as you can see here it isnt particularly simple (at least not for me!)

VBA Code:
Sub CreateShapes()

Dim posLeft As Long, posTop As Long, posWidth As Long, posHeight As Long
Dim ShapeMain As Shape, ShapeVertLine1 As Shape, ShapeVertLine2 As Shape
Dim ShapeHorLine1 As Shape, ShapeHorLine2 As Shape, ShapeLongDiag1 As Shape
Dim ShapeLongDiag2 As Shape, ShapeLeftDiag1 As Shape, ShapeLeftDiag2 As Shape
Dim ShapeRightDiag1 As Shape, ShapeRightDiag2 As Shape

posLeft = 5
posTop = 5
posWidth = 300 + posLeft
posHeight = 200 + posTop

With Sheets("Sheet1")
    Set ShapeMain = .Shapes.AddShape(msoShapeRectangle, posLeft, posTop, posWidth, posHeight)
    Set ShapeVertLine1 = .Shapes.AddConnector(msoConnectorStraight, posWidth / 3 + posLeft, posTop, posWidth / 3 + posLeft, posHeight + posTop)
    Set ShapeVertLine2 = .Shapes.AddConnector(msoConnectorStraight, posWidth * 2 / 3 + posLeft, posTop, posWidth * 2 / 3 + posLeft, posHeight + posTop)
    Set ShapeHorLine1 = .Shapes.AddConnector(msoConnectorStraight, posLeft, posHeight / 3 + posLeft, posWidth + posLeft, posHeight / 3 + posLeft)
    Set ShapeHorLine2 = .Shapes.AddConnector(msoConnectorStraight, posLeft, posHeight * 2 / 3 + posLeft, posWidth + posLeft, posHeight * 2 / 3 + posLeft)
    Set ShapeLongDiag1 = .Shapes.AddConnector(msoConnectorStraight, posLeft, posTop, posWidth + posLeft, posHeight + posTop)
    Set ShapeLongDiag2 = .Shapes.AddConnector(msoConnectorStraight, posLeft, posHeight + posTop, posWidth + posLeft, posTop)
    Set ShapeLeftDiag1 = .Shapes.AddConnector(msoConnectorStraight, posLeft, posTop, posWidth / 3 + posLeft, posHeight + posTop)
    Set ShapeLeftDiag2 = .Shapes.AddConnector(msoConnectorStraight, posLeft, posHeight + posTop, posWidth / 3 + posLeft, posTop)
    Set ShapeRightDiag1 = .Shapes.AddConnector(msoConnectorStraight, posWidth * 2 / 3 + posLeft, posTop, posWidth + posLeft, posHeight + posTop)
    Set ShapeRightDiag2 = .Shapes.AddConnector(msoConnectorStraight, posWidth * 2 / 3 + posLeft, posHeight + posTop, posWidth + posLeft, posTop)
    Set ShapeGroup = .Shapes.Range(Array(ShapeMain.Name, ShapeVertLine1.Name, ShapeVertLine2.Name, ShapeHorLine1.Name, ShapeHorLine2.Name, _
        ShapeLongDiag1.Name, ShapeLongDiag2.Name, ShapeLeftDiag1.Name, ShapeLeftDiag2.Name, ShapeRightDiag1.Name, ShapeRightDiag2.Name)).Group
    With ShapeGroup
        .ShapeStyle = 1
        .Placement = xlFreeFloating
        .LockAspectRatio = msoTrue
    End With
End With
    
End Sub
 
Upvote 0
Thanks! These are helpful.

Using the XY Scatter charts as described in the Microsoft web page looks like it will "almost" do what I need. The problem that I still have is with the axis scaling.

I can enter the x and y dimension of my painting canvas and the XY scatter plot does a nice job of drawing it. The problem I have is that when I then change the input x and y dimension, but plot isn't to the same proportion. I started with a 16 by 20 canvas and it looks OK. Then I changed to a 20 by 20 and the shape stayed rectangular. The autoscaling is what is causing my problem. I need both axes to have the same scale. Autoscaling would be helpful for
 
Upvote 0
Autoscaling would be helpful for going from a 4 by 5 canvas to an 18 by 24 to make the drawing large enough to work with and see, but I need both axes to be scales the same.

I can manually change the axes but I'd like to make it simpler to use.

Is there a way I can let it autoscale one axis and then copy the scaling to the other axis so that both are the same?

I'm going to study the VBA code, but as you say, it looks like it isn't very easy.

Getting closer!
 
Upvote 0

Forum statistics

Threads
1,223,663
Messages
6,173,649
Members
452,525
Latest member
DPOLKADOT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top