Jump to content
  • 0

Move Z by record?


Hans-Olav

Question

Hi 

I have imported a shape file with contour lines. The lines come in as 3d polys with Z=0 and a record with info on the right Z hight.

I have previously used Tools/ record/ "modify by record" to move 2d polygons to the right z hight.

 

There are no option available to Move-Z by record.

 

I have tried to convert the 3d polygons to 2d polygons but something weird is happening with the record format and the Z heights are scrambled 

 

I have made a Data Viz that color the lines by record Z 

 

3d polys:

2001537454_Skjermbilde2023-02-15kl_15.11_15.thumb.png.0209a9fcacd6a2aa39068f7590e58546.png

 

After Convert to 2d polys:

1226041684_Skjermbilde2023-02-15kl_15_12_39.thumb.png.0059ee3046e5f54ce9c81d2014f725be.png

 

I should probably report a bug for this?

 

Does anybody have a script or other workaround to move the 3d polys according to their z height?

Shape grunnur.vwx

 

Link to comment

9 answers to this question

Recommended Posts

  • 0

I think this does what you need. At least after I run it and look at a right view it shows the contours at different heights.

 

Procedure MoveZByRecord;
{©2023  Pat Stanford - pat@coviana.com}
{licensed under the Boost Software License 1.0}
{https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt}
{TL/DR Use as you want, attribution for source, No warranty}

{Move all objects in the layer and class specified in the ForEachObject Line}
{by the value in the Record.Field specified in the Const Block multiplied}
{by the value in Constant ThisScale to allow unit conversion.}

CONST	ThisRecord='HlinOlavRec';
		ThisField='HAED';
		ThisScale=1000;
		
VAR		H1,H2	:Handle;
		R1		:Real;
		B1		:Boolean;

Procedure Execute(Hd1:Handle);
	BEGIN
		B1:=ValidNumStr(GetRField(Hd1,ThisRecord,ThisField),R1);
		R1:=R1*ThisScale;
		Move3DObj(Hd1, 0, 0, R1);
	End;
	
BEGIN
	ForEachObject(Execute, (((L='Design Layer-1') & (C='LOD-Haedarlinur'))));
End;

Run(MoveZByRecord);

 

  • Love 1
Link to comment
  • 0

@Hans-Olavim late to the party here, but I was able to do this by….

Change units to meters

modify by record (use your HAED field)

   Choose “elevate 2d polys”

    Multiplier =1

change units back to millimeters

 

this moved the 3D polys as expected to the correct elevation.

 

You can skip the whole changing units thing by using a multiplier of 1000.

 

I’m failing to see where the problem is or why a script would be required.

  • Like 1
Link to comment
  • 0
9 minutes ago, Pat Stanford said:

 

I believe the original objects were 3D polys, not 2D, so Modify by Record would require them to be converted first.

 


I think vectorworks needs to work on the menu lingo.  It doesn’t matter if the polys are 2D or 3D, it will move them by record nonetheless 🙂

 

Try it and be amazed.

 

 

  • Like 2
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
Answer this question...

×   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...