Hi there.. I am now using AutoCAD 2013.. Is it possible to change hatch layer via excel input through VBA or LISP? Or other methods? I have a plaza floor plan with each hatch for each unit (room) to represent unit type. I also have an Excel spreadsheet that contains room number in column A (001, 002, 003,..., etc) and unit type in column B (Small Shop, Food, Hypermarket, Cinema, Department Store, etc). Is is possible to update layers in AutoCAD automatically when we change unit type in column B? For example: Unit No. 001 change from Small Shop to Food, and Unit No. 005 change from Hypermarket to Cinema.., and then the layer in AutoCAD updates automatically. The floor plans contains about 300 units and 50 different layers to represent unit type. If this is possible, it would save the amount of time & effort than selecting hatch one by one and change the layer. I have never used VBA nor LISP before., but I eager to learn. Any clue will be much appreciated.. Regards, Bagus
yes, you can search for the text in autocad which matching in the excel. and find the hatch boundary which accommodate that text and apply the layer from excel. hatch boundary is a closed polyline, from the number of intersection points of a ray starting from the text, you can assume whether the text is within the closed polyline or not. or create a selection set, add objects choosing select by polygon assign hatch boundary vertex list as the polyline vertex list , then if the text is matching change the layer.
i m getting this error Sub access_cad() Dim MyApp As Object Dim MyDwg As ZcadDocument On Error GoTo ERRORHANDLER Set MyApp = GetObject(, "Zwcad.Application") ERRORHANDLER: If Err.Description "" Then Err.Clear Set MyApp = CreateObject("Zwcad.Application") End If Set dwg = MyApp.ActiveDocument Sheet1.Cells(1, 1).vlue = dwg.Name End Sub Runtime error 429 on the line Set MyApp = GetObject(, "Zwcad.Application")
Excellent tutorial. Thank you very much for creating this!
Very nicely done! Thank you for doing it.
this tutorial very great
Very helpfull thanks
Please conduct tutorial series.
great
Upload next video to learn how to draw circle, line, text in cad using excel
GREAT
Thanks sir
very informative
but I need explanations in your voice..
Hi there..
I am now using AutoCAD 2013.. Is it possible to change hatch layer via excel input through VBA or LISP? Or other methods?
I have a plaza floor plan with each hatch for each unit (room) to represent unit type. I also have an Excel spreadsheet that contains room number in column A (001, 002, 003,..., etc) and unit type in column B (Small Shop, Food, Hypermarket, Cinema, Department Store, etc).
Is is possible to update layers in AutoCAD automatically when we change unit type in column B? For example: Unit No. 001 change from Small Shop to Food, and Unit No. 005 change from Hypermarket to Cinema.., and then the layer in AutoCAD updates automatically. The floor plans contains about 300 units and 50 different layers to represent unit type. If this is possible, it would save the amount of time & effort than selecting hatch one by one and change the layer.
I have never used VBA nor LISP before., but I eager to learn.
Any clue will be much appreciated..
Regards,
Bagus
yes,
you can search for the text in autocad which matching in the excel. and find the hatch boundary which accommodate that text and apply the layer from excel. hatch boundary is a closed polyline, from the number of intersection points of a ray starting from the text, you can assume whether the text is within the closed polyline or not. or create a selection set, add objects choosing select by polygon assign hatch boundary vertex list as the polyline vertex list , then if the text is matching change the layer.
i m getting this error
Sub access_cad()
Dim MyApp As Object
Dim MyDwg As ZcadDocument
On Error GoTo ERRORHANDLER
Set MyApp = GetObject(, "Zwcad.Application")
ERRORHANDLER:
If Err.Description "" Then
Err.Clear
Set MyApp = CreateObject("Zwcad.Application")
End If
Set dwg = MyApp.ActiveDocument
Sheet1.Cells(1, 1).vlue = dwg.Name
End Sub
Runtime error 429 on the line Set MyApp = GetObject(, "Zwcad.Application")
what is the application you are using
. I am not familiar with the said application
type F2 you can see the application name which they belongs to