Jump to content
Developer Wiki and Function Reference Links ×

Convert 2D locii to 3D locii


Recommended Posts

Hi,

Can anyone post a script to convert all 2D locii to 3D locii?

I have a survey file with over a thousand 2D locii. I want them to be 3D so I can create a terrain. Each 2D locus has a text box next to it with the height of the point. Would it be possible to tell the script to take the numeric value from each text box and insert it into the Z value of the 3D locus? The script would have to locate the nearest text box to each 2D locus. Might be a bit tricky.

Thanks in advance.

Link to comment

I figured out a workaround:

The locii are part of a survey DWG file that I have imported. I re-imported it with 'convert all objects to 3D' enabled, so now all the 2D locii are 3D locii.

Still, would be interested to see what the script would look like as I would like to learn more about VectorScript.

Link to comment
  • 4 months later...

I have had this problem with quite a few surveys that have only provided 2D information.

First of all I have a script that converts all 2D loci to 3D which I can post later.

Then the next script is still quite long winded.

What it does is if you select the text box with the spot height in it and the 3d loci, it will move the 3D loci in the Z axis to the value in the text box.

Surveys normally come in metres and I work millimetres so it times the value by 1000 to move it in mm you can delete that bit if you want.

{With a textbox and 3dloci selected it moves the 3D loci in the Z axis to the value in the text box}

PROCEDURE ConvTEXTto3DZ;

VAR

waldo,myHan,h,itemHdl : HANDLE;

index,colour : INTEGER;

Zme,locX,locY,locZ :REAL;

testString,criteria :STRING;

BEGIN

Locus(0,0);

waldo:=LNewObj;

myHan:=PrevObj(waldo);

DelObject(waldo);

itemHdl:= myHan;

colour:= 32;

WHILE (itemHdl <> NIL) DO BEGIN

CASE GetType(itemHdl) OF

10:BEGIN

testString:=GetText(itemHdl);

Zme:= Str2Num(testString);

locZ:= Zme * 1000; {converts meters to mm}

SetPenFore(itemhdl,colour);

END;

9:BEGIN

Move3DObj(itemHdl,0,0,locZ);

SetPenFore(itemhdl,colour);

END;

END;

itemHdl:= PrevSObj( itemhdl );

END;

END;

RUN(ConvTEXTto3DZ);

The script also colours both the text box and the 3D loci blue so I know which ones I have done.

It still leaves quite a bit of work to do but if you put the script on your right click menu you get through most surveys quite quickly.

If anyone has any other faster methods I would love to hear them.

Also thanks to waldo for the waldo handle method, I use it a lot.

Edited by amogle
Link to comment
  • 4 weeks later...

Some times it is worth calling the surveyor and asking what they have used to create the survey. I had a crappy 2D survey come through recently. I could not get the info I needed for the DTM. I called the surveyor and asked what they could export. I think they just sent me a mesh. I was able to select the mesh and convert directly into the DTM.

I set the DTM to have the same intervals for contours as the 2D drawing sent. I overlaid the 2D contour drawing I originally received and incredibly the contours were exactly the same!.

Most surveys are now smart 3D models of the land. The info we get is a translation of the 3D into 2D for printing. We then get sent the DXF of the 2D out put. Thus it pays to always ask for both the 3D mesh and 2D drawing.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...