Update AUTOCAD Drawing Using EXCEL formulas - Part 1

Excel_ing CAD - Layer Management

Prerequisite to apply our formula in the specified drawing :

  • Autocad drawing Coordinates
  • Simple Excel Formulas
Steps to get coordinates of Text/Object in AUTOCAD :

Select Text/Object ⇒ Select Similar ⇒ Isolate objects (To get minimum items to be extracted) ⇒ DATAEXTRACTION ⇒ Create a new data extraction ⇒ next ⇒ save (with any name anywhere) ⇒ Select objects in the current drawing ⇒ Enter (After selecting Desired area)
⇒ Next ⇒ Select the objects to extract data from 

⇒ Next ⇒ Select Properties needed (Must select Geometry also to get coordinates) 










⇒ Next ⇒  Next ⇒ Output data to external files (.xls type) ⇒ Specify the path ⇒ Next

 ⇒ Finish










This would be the extracted file in .xls format having coordinates and their Text/Values. we are going to use the same Text and their coordinates.



Once we have the Text/Value, X-coordinate, Y-coordinate and Rotation of the object, We can proceed to the next step to modify the Values as per our need without editing individual Data in CAD. "It's quite helpful when we have numerous data to update one by one."

Another method to get the coordinates :

We can draw a polyline by clicking on the points where we need the values or text. After that, we can use the command "LIST" to have the coordinates of all the points we selected while making our polyline in sequence. (This method can be useful when we wish to place our own text/object at our specified place.)

Overall we need to have the coordinates of items for addressing those commands in AUTOCAD.

Now we can make a formula in excel to use in the command line of AutoCAD to get the desired results:

  • First, try the command in AutoCAD to have an idea of the steps involved and same we can apply it in excel.
  • Make sure to have the same "SPACE" and "Enter" as AutoCAD in the formula we are going to use in Excel.
  1. Layers Management :
  • MAKE
  • SET
  • ON
  • OFF
  • LOCK
  • UNLOCK

 ="-LA "&"Make"&" "&"LAYER NAME"
RESULT =  -LA Make _AKS_ELE_LAYER-1







="C "&1
RESULT =  C 1

=""    (FOR SPACE)

                               



         
="LW "&"LINE WEIGHTS"
RESULT =  LW Default

=""    (FOR SPACE)










="L "&"LINE TYPE"
RESULT =  L CONTINUOUS

=""    (FOR SPACE)









⇒ BEFORE ADDING NEW LAYERS

















 COPYING ALL FORMULAS FOR LAYERS ONE UNDER 
                                    
⇒ AFTER PASTING ALL FORMULAS IN THE COMMAND LINE

Similarly, we can follow these tasks as well
  • SET
  • ON
  • OFF
  • LOCK
  • UNLOCK
Sample File: - Layers Management

Comments

Post a Comment