PDA

View Full Version : Pattern a dimension in solidworks '12 ?



Kealan O Carroll
10-02-2012, 01:21 PM
Hi all, I've moved some excel equations over to solidworks dimensions to avoid manually swapping back and over between excel and SW and manually plotting points.

Basically, my dimension looks like this:
=( ( SIN ( ( "D4@Sketch1" / 2 ) * ( ( 3.141 ) / 180 ) ) ) * ( "D2@Sketch1" ) ) / ( SIN ( ( ( 3.141 ) - ( ( "D4@Sketch1" / 2 ) * ( ( 3.141 ) / 180 ) ) ) / 2 ) )-( ( SIN ( ( "D1@Sketch1" / 2 ) * ( ( 3.141 ) / 180 ) ) ) * ( "D2@Sketch1" ) ) / ( SIN ( ( ( 3.141 ) - ( ( "D1@Sketch1" / 2 ) * ( ( 3.141 ) / 180 ) ) ) / 2 ) )

And needless to say I don't wanna have to do 90 of them by hand. Is there any way to get SW to recognise a pattern and paste the dimension onwards ?
Much the same as grabbing the bottom right corner of an excel cell and copying it down a column...

Cheers

Francis Gagné
10-02-2012, 02:07 PM
Hi Kealan,

You can use the Solidworks API (in VBA) to read or write data to SW from Excel.

There is info on how it works here : http://help.solidworks.com/201...nsion_Example_VB.htm (http://help.solidworks.com/2012/English/api/sldworksapi/Change_Dimension_Example_VB.htm)

You can probably find some ready-to-use macro on the web. We use this method for calculating our suspension sketches dimensions in VBA from our parameters and updating the CAD and it works quite well (and is very fast)!

*NOTE: Dimensions are retrieved or sent through the API as meters and degrees if I recall.