Cloud Hidden Posted September 8, 2003 Share Posted September 8, 2003 I can get some wall info through Get3DInfo, and some through WallHeight, but neither tell the bottom Z value of the wall, such as would show in the OIP. Is that a function I'm just overlooking? As a corollary, for a round wall, how do you find out the curvature...radius, center of curvature, etc. Thanks. [ 09-08-2003, 08:17 PM: Message edited by: Cloud Hidden ] Quote Link to comment
Cloud Hidden Posted September 11, 2003 Author Share Posted September 11, 2003 Still stumped after trying a bunch of things...any idea how to get the "Delta Z" and "Bottom Z" values for a wall object? Quote Link to comment
Alexandre Villares Posted September 11, 2003 Share Posted September 11, 2003 Have a look at this (select a wall first): code: Procedure WallInfo; VAR pX, pY, zValue: REAL; height,width,depth:REAL; BotZ :REAL; hWall : HANDLE; BEGIN hWall:=FSActLayer; {Handle to the First Selected object at the Active Layer} Get3DCntr(hWall , pX, pY, zValue); Get3DInfo(hWall , height,width,depth); BotZ:= zValue - (depth/2); Message(Concat('BotZ=',BotZ,' DeltaZ=',depth)); END; Run (WallInfo); [/code] Quote Link to comment
Cloud Hidden Posted September 12, 2003 Author Share Posted September 12, 2003 Well, darn if that doesn't work! Thanks. I was looking for that parameter directly and even via other calculations, and never paid attention to 3DCntr. It's great they have VS, but frustrating at the same time be/c of missing functions like that one. Another I'm grappling with is that you can add a wall peak and get a wall peak, but you cannot (as far as I can tell) set a wall peak or delete an individual wall peak. Sometimes it's hard to follow their reasons... [ 09-12-2003, 01:20 AM: Message edited by: Cloud Hidden ] Quote Link to comment
Cloud Hidden Posted September 12, 2003 Author Share Posted September 12, 2003 I've become suspicious that GetWallPeak does not work. Could you, Alexandre, or anyone else, run this script and see if it does or does not show you the coordinates of the wall peaks in a selected wall: code: Procedure WallInfo; VAR pX, pY, zValue: REAL; hWall : HANDLE; i :INTEGER; str :STRING; BEGIN hWall:=FSActLayer; {Handle to the First Selected object at the Active Layer} i := 0; while i < GetNumWallPeaks(hWall) do begin GetWallPeak(hWall, i, pX, pY, zValue); str := concat('GetNumWallPeaks ', Num2Str(1, GetNumWallPeaks(hWall)), ', i ', Num2Str(1, i), ', px ', Num2StrF(px), ', py ', Num2StrF(py), ', zValue ', Num2StrF(zValue)); AlrtDialog(str); i := i + 1; end; END; Run (WallInfo); [/code] Edit: Upon further investigation, it always seems to return the coordinates of the last wall peak, regardless of the index parameter. Edit: And why is this a 0-based index? If you have 1 peak and you pass 1 as the index, you get 0's as the peak. Pass 0 as the index and you get the correct peak. I thought Pascal was more 1-based than 0-based. [ 09-12-2003, 09:59 AM: Message edited by: Cloud Hidden ] Quote Link to comment
MullinRJ Posted September 12, 2003 Share Posted September 12, 2003 quote: And why is this a 0-based index? If you have 1 peak and you pass 1 as the index, you get 0's as the peak. Pass 0 as the index and you get the correct peak. I thought Pascal was more 1-based than 0-based. As it pertains to arrays, Pascal is not based on either index. That bias is introduced by the programmer. An array can be declared with any integer as its base. Typical definitions are the ones you mentioned, such as: VAR PeaksArray : array [0 .. 8] of Real; or: PeaksArray : array [1 .. 9] of Real; but this is also valid: PeaksArray : array [-4 .. 4] of Real; The same applies to DynArrays, but the range is applied at runtime with the Allocate statement. There are other data types in Pascal that are 0 based, the SET data type for one, but I don't think VectorScript supports it. In all cases, the index range is not nearly as important as the documentation. HTH, Raymond Quote Link to comment
Cloud Hidden Posted September 12, 2003 Author Share Posted September 12, 2003 quote: In all cases, the index range is not nearly as important as the documentation.That certainly answers the one question. Woulda been nice if they mentioned if the index was 0 or 1 for GetWallPeaks. That coulda prevented a lot of time-wasting. I'm a one-time C developer, and have 0 drilled into my brain, and in translating to Pascal, assumed 1, be/c that's what I've seen in sample code. Thanks for the explanation. (and I'll never get used to := for assignments!) Still looking for answers on GetWallPeaks. I'm guessing that most people only have one wall peak, and that was the test case. Unfortunately for me, I have lots. Quote Link to comment
Vectorworks, Inc Employee Andrew Bell@NV Posted September 12, 2003 Vectorworks, Inc Employee Share Posted September 12, 2003 quote: Originally posted by Cloud Hidden: Still looking for answers on GetWallPeaks. I'm guessing that most people only have one wall peak, and that was the test case. Unfortunately for me, I have lots. GetWallPeak and GetNumWallPeaks was partially broken in 10.1.2 and before, and my attempted fix made GetWallPeak worse. I've buglisted it, and have a fix ready that should be in the next release. I can't tell you when or what release that will be. The partially broken code used 1 as the index of the first peak, so I'll make sure it stays that way. (Its problem was that it also considered wall joins and symbols in the wall to be "peaks" when counting, and then would return bogus when you used GetWallPeak to get the values for one of those "peaks.") Unfortunately, VectorScript is not consistent in its choice of 1 as the first index, or 0 as the first. GetPolyPt uses 1 as the first index, GetPolyPt3D uses 0. But then isn't a foolish inconsistency the hobgoblin of little minds?... Quote Link to comment
Cloud Hidden Posted September 12, 2003 Author Share Posted September 12, 2003 Andrew, thanks for a coherent response. 0 or 1 doesn't matter as long as it's added to the documentation. While you're at it, any chance of getting SetWallPeaks to set the Z value? Here's what I'm doing. Creating a polyline from a wall. Extruding it to wall height. Intersecting it with a nurbs surface. Convert to mesh. AddWallPeak @ 16" offset. GetWallPeak to find the X and Y. Walk the mesh to get the two closest points and interpolate a Z. Without SetWallPeak, I have to build an array of the Z's. With a malfunctioning GetWallPeak I have to clear wall peaks. Then I increment the offset 16" more, and add the next wall peak. When all is done, I clear once more, and add each peak again using the Z value I stored. It works, and it'll save me literally hours of work, but it's not clean. Any improvements y'all can offer are welcome. If you know who handles the wall framer, this exercise pointed out a bit of a problem with that that would be great to have adjusted. I wrote it in the VW Architect area. Quote Link to comment
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.