Linking excel cells with autcad parameters

Linking excel cells with autcad parameters

Anonymous
Not applicable
780 Views
9 Replies
Message 1 of 10

Linking excel cells with autcad parameters

Anonymous
Not applicable

Hello!

 

Is there someone who can tell me, a rule (macro) to link cells from excel with parameters in auto cad. For a exceple, i have a radius, and a parameter in excel, and i whant drive that radius in auto cad with my excel

 

Thank you

Aleksandar Jovicic

 

0 Likes
781 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

Hi,

 

You should explain more what you need.

It's possible to link to Acad with Excel and do more than assigning a radius but you shoul tell us what to do with that raduis after getting it's value from Excel.

 

 

0 Likes
Message 3 of 10

Anonymous
Not applicable

Hi and thank you for the reply.

 

I want ti drawn a crircle (or a recatngle), define the parameter in auto cad, and make a linke between the parameters from autoCAD and excel cell (for exemple, R=10 mm).

 

And after changing the parameter from excel, i want to change the dimensions (parameters) in atuo CAD

 

Thanks

Aleksandar Jovicic

 

0 Likes
Message 4 of 10

Anonymous
Not applicable

Hi,

 

Why don't you draw cercles with Excel by specifying X,Y and radius I think other parameters....

Take a look here:

http://www.myengineeringworld.net/2014/03/drawing-circles-autocad-excel-vba.html

 

0 Likes
Message 5 of 10

Anonymous
Not applicable

Hi,

 

This exemople that you just send me doesend work in my excel and auto cad.

 

and I would like to leran hoe to link excel and autoCAD, in a simple exemple, with circle or rectangle.

 

 

0 Likes
Message 6 of 10

Anonymous
Not applicable

Hi,

 

what version of Autocad do you have?

0 Likes
Message 7 of 10

Anonymous
Not applicable

Hi

 

I use AutoCAD 2015 and excel 2013

 

 

 

0 Likes
Message 8 of 10

Anonymous
Not applicable

Well!!

 

Try this code. It work fine with Excel VBA but don't forget to load autocad library in references tools...

 

 

Public Sub Circl()

Dim BaCercle As AcadCircle
Dim PtCentre(0 To 2) As Double
Dim dblRayon As Double
Dim CalquenCours As AcadLayer
Dim intCouleur As Integer

PtCentre(0) = 200
PtCentre(1) = 100
PtCentre(2) = 0
dblRayon = 50

Set BaCercle = AutoCAD.Application.ActiveDocument.ModelSpace.AddCircle(PtCentre, dblRayon)
Set CalquenCours = AutoCAD.Application.ActiveDocument.ActiveLayer
Select Case CalquenCours.name
Case "0"
intCouleur = 5
Case "MURS"
intCouleur = 3
Case "CLOISONS", "PORTES"
intCouleur = 2
Case Else
intCouleur = 1
End Select
BaCercle.Color = intCouleur
BaCercle.Update

End Sub

 

It allows to choose the layer and to set a color if layer XXX is active...Vey easy to understand.

@+

0 Likes
Message 9 of 10

Anonymous
Not applicable

Hello and much thanks for the VBA!

 

I can define any cell in my excel tabell?

For exeple A1 (name), B1 (diameter), C1 (unit)?

Or wich cell muss I take?

 

0 Likes
Message 10 of 10

Anonymous
Not applicable

No need to define cell!

Create a new module

Excute

0 Likes