Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawings in Excel

Status
Not open for further replies.

meca

Structural
Jul 28, 2000
128
Does anybody know how to create a drawing or sketch in Excel which is dynamically driven by values in the spreadsheet? In other words, if I have a spreadsheet which designs a certain component, is it possible to create a sketch of that component within excel where the dimensions of the component are changed in real time based upon what the user enters?

Thanks,

Chris
 
Replies continue below

Recommended for you

meca
Now you want a spreadsheet to be a parametric CAD program.

Link your Excel spreadsheet with your CAD program. Its probably already been done by somebody.
 
You can probably do it using Visual Basic, either using Excal drawing commends (rather primitive) or by calling Visio funtions.
 
Visio has just that functionality built in

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

UK steam enthusiasts:
 
I've use an Excel chart to dynamically draw an irregular object. It basically uses x-y scatter plot using lines, for which endpoints are calculated from the spreadsheet data. Not too difficult for straight-line objects.
 
you can also embed a drawing object (like smartsketch) in a spreadsheet, and drive drawing parameters from the sheet and vice versa.
 
Thanks for the helpful suggestions. The links to smartsketch on the intergraph website are not working, so I'm not sure if this product is still on the market.

I have done some small experiments with the X-Y scatter plot, and this seems like a good and simple solution. I'm assuming I can also place text and autoshapes on the chart, but I haven't figured this part out yet.
 
If only the dimension figures change on your sketch you can create a textbox with a formula reference to a cell on the worksheet. Add a textboxt to the worksheet and instead of writing in the textbox position your cursor in the formula bar, then add your cell reference.

=$a$1

for example
 
meca,

here's a link to smartsketch that should work.

ppm.intergraph.com/smartsketch
 
It can be done. For example, check out:


and follow the links to "Spreadsheets". Download the application called "PlanSketch". This is a very clever spreadsheet which allows you to enter a table of column and beam locations and sizes, including floor penetrations etc, and produces a scaled drawing of the resulting floor layout. You might be able to examine the coding to see how it is done.

Hope this helps!
 
When you buy Mathcad, you'll receive also the parametric 2D drfting package SmartSketch. It is a nice CAD program, can be used also with Excel (I did it, it works nice). But as I said, you have to buy the Mathcad or SmartSketch alone.
 
You can use the built-in visual basic functions;
Line, Polyline, Rectangle, Curve, etc.

Here are some examples:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim triArray(1 To 4, 1 To 2) As Single
triArray(1, 1) = 25   'Assign values in code, Or
triArray(1, 2) = 100  'Read a table of values in the sheet
triArray(2, 1) = 100
triArray(2, 2) = 150
triArray(3, 1) = 150
triArray(3, 2) = 50
triArray(4, 1) = 25     ' Last point has same coordinates as first
triArray(4, 2) = 90     ' else not filled as a solid
Set myDocument = Worksheets(1)
myDocument.Shapes.AddPolyline triArray

Set myDocument = Worksheets(1)
With myDocument.Shapes.AddLine(10, 10, 250, 250).Line
    .DashStyle = msoLineDashDotDot
    .ForeColor.RGB = RGB(50, 0, 128)
    End With

With myDocument.Shapes.AddShape(msoShapeRectangle, 144, 144, 72, 72)
    .Name = "Red Square"
    .Fill.ForeColor.RGB = RGB(255, 0, 0)
    .Line.DashStyle = msoLineDashDot
    End With
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor