Hans-Olav Posted February 15, 2023 Share Posted February 15, 2023 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: After Convert to 2d polys: 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 Quote Link to comment
0 Pat Stanford Posted February 15, 2023 Share Posted February 15, 2023 Send me a sample of the contour lines and record and I will see what I can do for you. Should be a relatively easy script. 1 Quote Link to comment
0 Hans-Olav Posted February 15, 2023 Author Share Posted February 15, 2023 Exactly what i was hoping for! 🤩 The file is attached to the original post Quote Link to comment
0 Hans-Olav Posted February 15, 2023 Author Share Posted February 15, 2023 the record is HAED and reads forexample 56 (meters) and should be multiplied by 1000 Quote Link to comment
0 Pat Stanford Posted February 15, 2023 Share Posted February 15, 2023 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); 1 Quote Link to comment
0 Hans-Olav Posted February 15, 2023 Author Share Posted February 15, 2023 Thanks a lot Pat Worked perfect on first attempt! Let me know when you plan to visit Iceland, I owe you some beers! Quote Link to comment
0 Pat Stanford Posted February 15, 2023 Share Posted February 15, 2023 I just might take you up on the Hans-Olav. 👍 1 Quote Link to comment
0 Jeff Prince Posted February 16, 2023 Share Posted February 16, 2023 @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. 1 Quote Link to comment
0 Pat Stanford Posted February 16, 2023 Share Posted February 16, 2023 I believe the original objects were 3D polys, not 2D, so Modify by Record would require them to be converted first. But maybe even more important at to why a script was required is because I (I don't know about Hans-Olav) have never played with Modify by Record and had not idea that capability existed!!! Thanks Jeff Prince!!! 1 Quote Link to comment
0 Jeff Prince Posted February 16, 2023 Share Posted February 16, 2023 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. 2 Quote Link to comment
Question
Hans-Olav
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:
After Convert to 2d polys:
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
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.