Jump to content

maarten.

Member
  • Posts

    387
  • Joined

  • Last visited

Posts posted by maarten.

  1. ... and I couldn't find a 'Draw-Extruded-Rectangle (x1, y1, z1, x2, y2, z2)'-procedure.

    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?

  2. I couldn't find anything in the setvariable calls

    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);
    

  3. 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;

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

  5. 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;

  6. 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!

  7. 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);

×
×
  • Create New...