Jump to content

maarten.

Member
  • Posts

    387
  • Joined

  • Last visited

Everything posted by maarten.

  1. Yep, that's a know thing, it's documented in the function reference: http://developer.vectorworks.net/index.php/VS:HExtrude When looking up functions I don't use to often, I use the online function reference, because there are things that aren't present in the offline version. The offline version is more of a stripped down, fast version.
  2. You can create a wrapper function that will create extrudes based on two 3Dpoints: FUNCTION BlockByBBox (p1, p2: POINT3D): HANDLE; BEGIN BeginXtrd (p1.z, p2.z); Rect (p1.x, p1.y, p2.x, p2.y); EndXtrd; END; Or something like this: FUNCTION BlockByBBox (p1X, p1Y, p1Z, p2X, p2Y, p2Z: REAL): HANDLE; BEGIN BeginXtrd (p1Z, p2Z); Rect (p1X, p1Y, p2X, p2Y); EndXtrd; END; But I don't realy understand what you try to accomplish... With this script, I get somewhat the same result. PROCEDURE Silver_Constant; CONST Psi = (1 / 2 + Sqrt (23 / 3) / 6) ^ (1 / 3) + (1 / 2 - Sqrt (23 / 3) / 6) ^ (1 / 3); TYPE DDD_ARRAY = STRUCTURE X : ARRAY [0..7] OF REAL; Y : ARRAY [0..7] OF REAL; Z : ARRAY [0..7] OF REAL; END; VAR P, L : DDD_ARRAY; a, z, n : LONGINT; SD : REAL; Obj_H : HANDLE; FUNCTION Block (p1, p2, l1, l2: REAL): HANDLE; BEGIN BeginXtrd (p1, l1); RectangleN (p1, p2, 1, 0, l1, l2); EndXtrd; END; BEGIN SD := RealDialog ('Enter the dimensions of the smallest block', '100'); FOR a := 0 TO 7 DO BEGIN FOR z := 7 DOWNTO 0 DO BEGIN FOR n := 0 TO 7 DO BEGIN P.X[a] := SD * (SD - (SD * Psi ^ a)) / (SD - (SD * Psi)); P.Y[z] := SD * (SD - (SD * Psi ^ a)) / (SD - (SD * Psi)); P.Z[n] := SD * (SD - (SD * Psi ^ a)) / (SD - (SD * Psi)); L.X[a] := SD * Psi ^ a; L.Y[z] := SD * Psi ^ a; L.Z[n] := SD * Psi ^ a; Obj_H := Block (P.X[a], P.Y[z], L.X[a], L.Y[z]); Obj_H := Block (P.X[z], P.Y[a], L.X[z], L.Y[a]); END; END; END; END; RUN (Silver_Constant); Be aware that you're creating a lot of objects that have the same dimension and position. Is this neccesary? Maybe if you tel us what the result should be, we could help you better?
  3. Indeed, and the good thing about Concat is that it doesn't add any decimal digits if there aren't any. That's why I suggested that it could have solved it too (9 will be 9 after Concat).
  4. Using Concat() to make a string of a number could have solved it too I think. I use it sometimes because it converts almost anything to a string (even a Handle).
  5. Not completely sure, but is that variable a Real? If so, what happens if you make it an Integer or Longint?
  6. Did you search in the appendix for it or did you ran trough all variables. I'm asking because some of those are just not documented. I run trough the variables if I can't find it in the appendix. I make a for-loop and write all the values to a text file. Then I search for the specific value and knows what the selector is. Script is something like this: Append(fileName); FOR i:=-3000 TO 3000 DO BEGIN Write(i); Tab(1); Write(GetPref(i)); Tab(1); Write(GetPrefInt(i)); Tab(1); ... Write(GetPrefString(i)); END; Close(fileName);
  7. Hi all Does anyone have a full list of the things you can fill in when you select "Custom" in "Tag Header" or "Tag Body"? It seems that this isn't listed in the Help.
  8. You can get the handle to the definition with symDefH:=GetObject(GetSymName(symH));
  9. If you have the handle to the symbol definition, this below should work. ObjH:=FInSymDef(SymDefH); WHILE ObjH<>NIL DO BEGIN IF GetTypeN(ObjH)=15 THEN BEGIN {this is a symbol inside your master symbol} END; END;
  10. I don't have a VW at the moment, but this should work: to get the symbol in the wall: symH:=FIn3D(WallH); to get the door inside the symbol: symN:=GetSymName(symH); doorH:=FInSymDef(GetObject(symN)); Maybe this one will work as well: doorH:=FInSymDef(symH); When you have more then 1 object in your wall, you need to loop trough them all with: symH:=NextObj(symH); UNTIL symH=NIL; Best is also to check the type of the object (should be 15 for symbol (or 16 for symbol definition)): objType:=GetTypeN(symH); And the same thing when you have more then one object in your symbol: doorH:=NextObj(doorH); UNTIL doorH=NIL;
  11. I believe the problem with GetView/SetView is that when you're in "2D/Plan" view, after the execution of your PIO, the view will be "Top".
  12. Are you really sure you need to switch the view to create the geometry? I believe that extrudes along (nurbs) path could do what you want without having to change the view. I'm just asking because changing the view by a PIO is not such a good idea qua performance.
  13. In the one I posted, folding should work. You have to make sure though to place your BEGIN and END; as first words. So this doesn't work normally: IF ... THEN BEGIN END; While this does work: IF ... THEN BEGIN END; I think a newer version can be found on the Notepad++ site.
  14. I have a Dutch version with an AZERTY keyboard with different workspaces, so I have no idea how it is called in your version or even what the shortkey is... Sorry. But it is the command that can join two selected lines (or in other words, stretch 2 lines to the point they have in common).
  15. Maybe I misunderstood you, but I believe the "join lines" menu command can do this. Select 2 walls and call that command. (so if you have a shortcut to that command, I believe you'll have what you want, I've used this for years and it was very fast imo)
  16. SetObjectVariableBoolean(handleToWorksheet,82,FALSE);
  17. There's a procedure on the VS mailing list that is far superior then the build in procedure. Here's the header of the procedure. With a search in the Mailing list you can easily find it. You'll also find some more additional information there. {Offsets a user-selected 2Dpoly by a given amount} {The User has also the choice to offset the poly on the left or the right} {This code is subject to the GPL License:} { Modified by Patrick Higgins, 11/29/03 } {www.gnu.org} {RafDouglas Candidi Tommasi Crudeli} {Udine - Italy} {08/11/2003} Procedure SingleSideOffsetPoly;
  18. I would use a AlertInformDontShowAgain(); or a AlertInform();. If you set the boolean "minorAlert" to True, the message will appear in the lower right bottom of VW (although i thought there was a preference somewhere to not show this or only give a sound alert, but i can't seem to find it...).
  19. I believe it does, it start on page 29 of the Language Guide. And the VS Func Ref states: "If the array is an array of structures, the fieldnumber argument denotes the element in the structure on which to sort." So, nothing wrong with the documentation I think (or this part at least, the rest could use some extra info ) Structures are very powerful and extremely handy!
  20. Seems to work here (win 7, vw2013). By running the script below as resource script, i get a dialog where "root1" is expanded and "root2" is collapsed. PROCEDURE Example; VAR dialog1 :INTEGER; result :INTEGER; widthInChars, heightInChars :INTEGER; root1, root2, child1, child2 :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); BEGIN CASE item OF SetupDialogC: BEGIN root1 := InsertTreeControlItem(dialog1, 4, 'root1', -1, 0); child1 := InsertTreeControlItem(dialog1, 4, 'child1', root1, 0); child2 := InsertTreeControlItem(dialog1, 4, 'child2', root1, child1); root2 := InsertTreeControlItem(dialog1, 4, 'root2', -1, root1); child1 := InsertTreeControlItem(dialog1, 4, 'child1', root2, 0); child2 := InsertTreeControlItem(dialog1, 4, 'child2', root2, child1); ExpandTreeControlItem(dialog1,4,0,TRUE); END; END; END; BEGIN dialog1 := CreateLayout('Example Dialog', FALSE, 'OK', 'Cancel'); widthInChars := 28; heightInChars := 8; CreateTreeControl(dialog1, 4, widthInChars, heightInChars); SetFirstLayoutItem(dialog1, 4); result := RunLayoutDialog(dialog1, Dialog_Handler); END; RUN(Example);
  21. I think you need to add another point back to P1, otherwise VW will close the poly for you and that will by default be a line. If you don't want to close the poly, you need to add the Procedure OpenPoly; before you start drawing your poly.
  22. These 3 create a different kind of arc, you could try them and see which one fits you best: ArcTo(); CurveThrough(); CurveTo(); If the above didn't help, you can also adjust your polyline after creation: SetPolylineVertex(); Smooth();
  23. Or by duplicating an object, adjusting something in the duplicate and then run through the ObjectVariables of both object and write down the differences. Some very interesting but also confusing stuff can be found there.
  24. Maybe something for in the meanwhile: with a shift+alt+click on one of the arrows, you can collapse/fold everything at ones.
  25. Didn't test it, but these should do the trick: SetObjectVariableReal(handle,102,xScaleFactor); SetObjectVariableReal(handle,103,yScaleFactor); SetObjectVariableReal(handle,104,zScaleFactor);
×
×
  • Create New...