PDA

View Full Version : problem with writing a script....2d contours.


roozbeh
08-07-2004, 03:07 PM
hi there....

i have never used writing scripts so i dont know anything about them....

my problem is i have some contours that in middle of each of them a text indicates height of the land.....i want somehow try figuring out x y z from this map...
how?

i thought maybe if i write an script wich try moving x and y and whenever it cross a polyline then try moving into that line until it ends;there must be a text aat the end of line with a caption and then convert that caption(which is height of land)into number and save it.....and if no text object find try moving into the other side....

any help?

Thanks

Eddie
10-07-2004, 11:26 AM
8) Correct me if i'm wrong....
You want to extract the x,y,z values of all the polylines ?

Q1 - Do you want to do all plines or just selected ones ?
Q2 - Do you need to write this info out to a text file ?

roozbeh
10-07-2004, 04:14 PM
yes almost correct....
but the problem is with z.....
all polylines are drawn at z=0 i want somehow programatically extract z info from a text written on each polyline which to me indicate z

Eddie
11-07-2004, 11:32 AM
8) Oh OK....Do you have a particular program language in mind for this ?

roozbeh
11-07-2004, 06:11 PM
no....noting particular..

i know some of programming languages but never used basic or lisp....

Eddie
12-07-2004, 09:41 PM
I have a VBA program that extracts the x,y,z values from plines...... I'll have a fiddle with it to see about getting the text info on plines with 0 z value.

I'll keep you inform on my progress.

Eddie
12-07-2004, 10:36 PM
8) Also...can you supply a sample drawing for me to test with ?

I have a VBA program that extracts the x,y,z values from plines...... I'll have a fiddle with it to see about getting the text info on plines with 0 z value.

I'll keep you informed on my progress.

roozbeh
13-07-2004, 04:25 PM
ok thanks....

here i attached the dwg file .

also i know it is somehow hard to write but this file is for our road making project and every one got this kind of problem.
they simply read the infos from it by hand,
I think it is very very common problem.

maybe you can then even sell you vba ;)

Eddie
19-07-2004, 11:04 AM
Roozbeh,
Are all your drawing like this one ???
where do you get the information for the contours from ?
Is it in format that could be imported to generate the lines on screen for you ?

I ask these question because it would take TOO much programing to achieve what you want....I can extract the X & Y values from the plines but the Z value would need to added manually.

roozbeh
20-07-2004, 09:54 AM
well anyway thanks for your effort.....

we extracted all infos by hand and i think it tool us about 1 week :))

but the problem is that silly one who made this cad file didnt put z information in anyway usefull.....

and we dont have access to original data....

i know it is hard to implement as i am myself programmer and extacting it is really hard in both theory and implementation but it is not impossiible

what i thought about implementing it was:
in anyway find the start of polyline and then move into it until you reach end and seek there to find a text and that text is your z

it is really hard but :))

anyway we finished the project.....
but i am sure if you can make it you can really sell it at a good price becouse we have many cad files like this

Eddie
20-07-2004, 10:52 AM
8) I will probably keep fiddeling with it when I have time....If have anything worth mentioning I'll post it here....