Solved! Go to Solution.
Solved by leeminardi. Go to Solution.
Hi @chriswasemann37,
Imad provided a great link that might get you started. I usually do this by using a CONCATENATE function in Excel. You are welcome to attach your Excel file and I can show you how this might be done. There are also a variety of add-ins available in the Autodesk App Store that might make this easier for you.
Please select the Accept as Solution button if my post solves your issue or answers your question.
Assuming columns A,B,C contain the x,y,z coordinates and column D contains the label, and your data starts in row 2, place the following in cell E2 (the location of spaces is very critical):
=CONCATENATE("point ",A2,",",B2,",",C2," ","text ",A2,",",B2,",",C2," ",0.4," ",0," ",D2," ")
then fill down, copy column E to Notepad and save as a text file with the extension .scr. You can use the script command in AutoCAD to run this script. I have assumed a text height of 0.4 and an angle of 0. You can change these values in the Excel concatenate function
Hi,
>> display point number (d2 cell) followed in second line the z elevation
Create 2 attributes for that, one for point number, the other one for z elevation.
Then make sure ATTDIA is set to 0 otherwise it might option the attedit dialog.
- alfred -
Hello
Maybe you can look at the beautiful "Point Manager" Routine from Lee Mac !
http://lee-mac.com/ptmanager.html
Regards, Patrice
Patrice BRAUD
This only can show points, not numbers or descriptions.
There are other prog. can do it.
Let's see your excel file.
Here's a modification to my post #4 that gives the TEXT command twice to enable two lines of text. I tried using the MTEXT command but had difficulty getting it to accept a new line in a script. I was able to do it with the TEXT command by using the unicode \U+000D for a carriage return. Note that 0.5 is subtracted from the y coordinate of the second text command to offset the second line of text. The 0.4 is the text height.
Here is the Excel formula to fill-down (spaces are critical).
=CONCATENATE("point ",A2,",",B2,",",C2," ","text ",A2,",",B2,",",C2," ",0.4," ",0," ",D2," \U+000Dtext ",A2,",",B2-0.5,",",C2," ",0.4," ",0," ",E2," ")
Again, copy the contents of column F to Notepad and Save As a text file with the extension .scr to run with SCRIPT.
Hi @chriswasemann37,
I am checking back to see if my post or others helped you with your problem. Please mark a post or posts as accepted solutions if they resolved the issue or give me a bit more detail on this issue so we can continue to work towards getting this solved.
Please hit the Accept as Solution button if a post or posts solves your issue or answers your question.
Running the formula as a script only drew one point and the point is very small. As I’m only a beginner in AutoCAD, I’m sure there is more explanition needed. I have my units set to feet since I’m working with surveying coordinates. I’ll Post some sample data when I’m at a desk top
Patrice BRAUD
Post the script file too so it can be analyzed to see why it is only creating one point.
After some practice I think I found the answer. Thanks for all your help.
In sheet 1 of the attached Excel file are the location of the point, columns for two labels for the point, a code #, and the layer name corresponding to the code number.
The contents of cell H2 is:
=CONCATENATE("-layer"," s ",G2," point ",A2,",",B2,",",C2," ","text ",A2,",",B2,",",C2," ",0.4," ",0," ",D2," \U+000Dtext ",A2,",",B2-0.5,",",C2," ",0.4," ",0," ",E2," ")
Note that there are two blank spaces before the word point
The correlation between a code# and a layer name is defined on sheet 2 as noted below. This array of values is named "LabelTable" and is referenced via the Excel VLOOKUP function in column G of sheet 1.
Copy and paste column G to Notepad and save as a txt file with the extension .scr then run the script in AutoCAD. (Note, it has been stated that you can simply paste the contents of the clipboard into AutoCAD. This did not work for me but the script file does work.)
Here is the data in Notepad:
Here are the results in AutoCAD:
Hey guys, this has been exactly what I've been trying to find so thanks so much! However, I was wondering what I would need to add to the formula to add further vertically offset labels? I'm very new to AutoCAD, mainly using it for site engineering stuff as opposed to anything design related and want to hopefully learn to develop these myself when I need them.