Script to change properties of an object

Script to change properties of an object

Anonymous
Not applicable
2,291 Views
15 Replies
Message 1 of 16

Script to change properties of an object

Anonymous
Not applicable

Hello everyone.

 

So i'm trying to create a point cloud that contains elevations.

Here's my format:

 

NUMBER . NUMBER

Each number is a seperate text that contains z axis coordinate and they have a dot between them

Example:

7 . 35

7 Meters [DOT] 35 Centimeters

 

What i want to do is to create a loop script that asks me to select the dot and then select Meter information and Centimeter information to merge these informations to change dot's elevation to that data.

 

I hope i explained clearly, I'm attaching a screenshot from my dwg.

 

Thanks in advance...

 

0 Likes
Accepted solutions (1)
2,292 Views
15 Replies
Replies (15)
Message 2 of 16

ara_neresesian
Collaborator
Collaborator

HI

IF I AM RIGHT THIS AN EXPORT OF OTHER APPLICATION AND YOU NEED TO COVERT  IT TO ONE TEXT (ELEVATION ) 

You can use

"txt2mtxt " in express tools by this setting

select by  order 7 . 35 AND PRES ENTER

mt.JPG

its  BETTER  THAN A  script or lisp

AND FOR LOOP YOU CAN USE "MULTIPLE" AND "txt2mtxt"

And at end remove  all spaces  with "FIND"

THEN YOU WILL HAVE ALL TEXT CONVERTED TO ON TEXT .

GOOD LUCK

Message 3 of 16

Anonymous
Not applicable

First of all thank you for the answer.

 

I'm very close to getting the result i want, but the problem is i have nearly 5 thousand texts like this and my question is; is there a way to use txt2mtxt seperately on each coordinate because if i select them all it converts all of them into one mtext.

0 Likes
Message 4 of 16

ara_neresesian
Collaborator
Collaborator

Hi

i have to say sorry

there is no way , i had this  Hard work back 10 years ago , you have to do it one by one

but tell me more ,

what  you want to do at all,Explain your goal

those ”.” Are text or point?

you want make countor (civil 3d)  line or you want to make surface ?

and send me a portion of file

if those point have z elevation  (not in text in properties ) , i have a lisp , which can export those point to text file

we will help you ,don’t worry 

good luck

 

Message 5 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

can you please upload the dwg-file with that text objects?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 6 of 16

Anonymous
Not applicable

I want to create a point cloud to generate topographic map. Texts are the z coordinates and the dots between them are "points".

 

I tried to use "multiple" command with "txt2mtxt" to do it one by one and after that export it to excel to use value as a z coordinate.

 

 

0 Likes
Message 7 of 16

Anonymous
Not applicable

Hi,

I'm trying to create contour lines or a "point cloud" i can use on other programs to generate topography.

 

I'm uploading a portion of the dwg

 

Thank you.

0 Likes
Message 8 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

is that a one type job or do you need that more often?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 9 of 16

Anonymous
Not applicable

I'm studying architecture and we are usually getting these types of dwgs. It would be very helpful to find an automated way of doing it to save a lot of time. Because i tried to do it manually and it took 2 hours to do a small portion of it

 

Thank you

0 Likes
Message 10 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> we are usually getting these types of dwgs

Really? That's one of the worst methods to transfer XYZ data ... which software creates such files and which other formats can be exported from them.

 

I can write a tool that handles this drawing, but for some special situations (overlapping text objects) could result in failures and at least, you should first take a look in alternative methods of exporting from the other application.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 11 of 16

Anonymous
Not applicable

This is the exported data. I have no clue which software they used to get this result.

 

It would be very helpful if you could do that.

0 Likes
Message 12 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> I have no clue which software they used to get this result.

Please ask the guys. Even if that sample here can be solved, whenever you get overlapping text objects you are running into troubles.

And again, it is a totally silly format to transfer XYZ values that way (sorry for the wording) and it is not safe (see above).

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 13 of 16

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

please find attached a dwg-file which has the modifications done, the points are moved to a Z-value according to my understanding of the job.

 

20191026_144625_0001.png

 

Within the file you'll find:

  • the points moved to Z
  • points and text color changed to green for objects matching together
  • lines in green showing the connection from point to text objects ... for visual control to see which text objects were used for the Z-value of the point (to prevent the wrong text value is found)
  • points and/or text objects in red in case something went wrong (not in that drawing, but build in into code)

 

I have also attached a VBA file (you'll need to install the AutoCAD Visual Basic Enabler >>>click<<< to load and run the project).

  • You can use command _VBALOAD to load the DVB file
  • You can use command _VBARUN to run the procedure "PntToTxtZ"

 

Please take care, this tool is written without error handling and without warranty that it does what you expect. So please save before running the code and verify the result.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 14 of 16

Anonymous
Not applicable

Hi, thank you so much for your help, i guess the only error with this is overlapping objects right? Because it's trying to find closest text from left to right and merging them. 

 

Again thank you so much for your help.

0 Likes
Message 15 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> i guess the only error with this is overlapping objects right?

Yes, and therefor the data exchange in that way is not safe.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 16 of 16

ara_neresesian
Collaborator
Collaborator

HI

just want to say that kinds of text, and point belong to an old under DOS application which called

"SDR MAP" , but there is a setting on that software  which can export the text correctly  not like this ,

maybe you ask them to change the setting if you have to do kind of jobs, if you can ask them to export as a 3d  point not flat like  this.

And if you are using civil 3d to make a surface you dont need to make a cvs file,

You can import it directly to civil 3d

use this methods  see pic.

 .Capture.JPG

something else ,if you need a cvs file to make cloud ,you need only points (Alfred NESWADBA sent that file)

and with "dataextraction" in Aurocad you can export the points data  x,y,z to a file (the text are't necessary).

Capture1.JPG

Good luck