Jump to content

DeSignature

Member
  • Posts

    44
  • Joined

  • Last visited

Posts posted by DeSignature

  1. Based on the info found on this forum and on the VectorLab-website, I've managed to create a PIO (Plug In Object) with a custom button in the OIP (Object Info Palette).

    I would like to use this button to create a legend in a custom Titleblock + geometry

    Workflow: push the button -> mark some boolean items in a Custom Dialog Box -> close the Dialog -> result

    On the VectorLab-website there is a note about creating geometry inside or outside the PIO, no problem up to here.

    How can we create a geometry inside the PIO after pushing the button.

    I can create the geometry after pushing the button, but then the geometry is created outside the geometry

    and

    I can create the geometry inside the PIO but then the button is rather useless as it's created by another part of the PIO-script.

  2. I'll keep that in mind.

    Meanwhile I found out that the code above doens't work properly in a PIO, just because of the following lines

    (...)
       RectangleN (Pos [a, z].P [z], Pos [z, a].P [a], 1, 0, Len [a, z].L [z], Len [z, a].L [a]);
       Ext_H := HExtrude (LNewObj, Bot [a, z].P [n], Top [a, z]. P [n]);
    (...)
    

    In a PIO this line should be replaced by:

    (...)
       BeginXtrd (Bot [a, z].P [n], Top [a, z]. P [n]);
           RectangleN (Pos [a, z].P [z], Pos [z, a].P [a], 1, 0, Len [a, z].L [z], Len [z, a].L [a]);
       EndXtrd;
    (...)
    

  3. Not really sure how I got there, but I'm there:

    PROCEDURE Silver_Constant;
    CONST
    Psi	= (1 / 2 + SQRT (23 / 3) / 6) ^ (1 / 3) + (1 / 2 - SQRT (23 / 3) / 6) ^ (1 / 3);
    TYPE
    STRUCTUUR = STRUCTURE
    	P, L	: ARRAY [0..6] OF REAL;
    END;
    VAR
    Pos, Len	: ARRAY [0..6, 0..6] OF STRUCTUUR;
    Bot, Top	: ARRAY [0..6, 0..6] OF STRUCTUUR;
    a, z, n		: LONGINT;
    SB			: REAL;
    Ext_H		: HANDLE;
    
    BEGIN
    SB := RealDialog ('Smallest Block Dimensions = ', '100');
    FOR a := 0 TO 6 DO
    BEGIN
    	FOR z := 6 DOWNTO 0 DO
    	BEGIN
    		FOR n := 6 DOWNTO 0 DO
    		BEGIN
    			Pos [a, z].P [n]	:= SB * (SB - (SB * Psi ^ a)) / (SB - (SB * Psi));
    			Len [a, z].L [n]	:= SB * Psi ^ a;
    
    			Bot [a, z].P [n]	:= SB * (SB - (SB * Psi ^ n)) / (SB - (SB * Psi));
    			Top [a, z].P [n]	:= (Bot [a, z].P [n]) + (SB * Psi ^ n);
    
    			RectangleN (Pos [a, z].P [z], Pos [z, a].P [a], 1, 0, Len [a, z].L [z], Len [z, a].L [a]);
    			Ext_H := HExtrude (LNewObj, Bot [a, z].P [n], Top [a, z]. P [n]);
    		END;
    	END;
    END;
    END;
    RUN (Silver_Constant);
    

    If anyone feels like to elaborate on what is actualy happening here, please do.

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

    Well, exactly that, every block (at the end there should be 83 of them) should have it's unique dimension and co?ridnates.

    I'm actualy trying to customize this system, kind of like Le Corbusier's Modulor.

    The 2D-part looks like this:

    PROCEDURE Silver_Number;
    CONST
    Psi	= (1 / 2 + SQRT (23 / 3) / 6) ^ (1 / 3) + (1 / 2 - SQRT (23 / 3) / 6) ^ (1 / 3);
    VAR
    P, L	: ARRAY [0 .. 7, 0 .. 7] OF REAL;
    a, z	: LONGINT;
    GT		: REAL;
    BEGIN
    GT := RealDialog ('Smallest Block Dimensions = ', '100');
    FOR a := 0 TO 7 DO
    BEGIN
    	FOR z := 7 DOWNTO 0 DO
    	BEGIN
    		P [a, z]	:= GT * (GT - (GT * Psi ^ a)) / (GT - (GT * Psi));
    		L [a, z]	:= GT * Psi ^ a;
    
    		RectangleN (P [a, z], P [z, a], 1, 0, L [a, z], L [z, a]);
    	END;
    END;
    END;
    RUN (Silver_Number);
    

    And yes, of course, we might leave the necessity open for discussion ... but - whatever the result of this discussion - it might help me understand coding vectorworks.

    Meanwhile I'll see what I can do with your - much appreciated - suggestions.

    Edit:

    Had to look really hard for it (at the most obvious place of course):

    English Version

  5. (...) just 3D points (...)?

    I don't understand your suggestion as the're actualy extruded rectangles, and I couldn't find a 'Draw-Extruded-Rectangle (x1, y1, z1, x2, y2, z2)'-procedure.

    There also seems to be a problem with the BeginXtrd-Procedure , allthough, I actualy don't know if this specific problem applies to my situation.

  6. So ... a few days later:

    I am getting n^3 results, just not the ones I was hoping for.

    X, Y is OK; Z doesn't seem to work well, so - hoping someone will see what I'm trying to do - I'll just drop some code in here.

    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
    	H	: ARRAY [0..7] OF REAL;
    END;
    VAR
    P, L	: ARRAY [0..7, 0..7] OF 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[a, z].H[n]	:= SD * (SD - (SD * Psi ^ a)) / (SD - (SD * Psi));
    			L[a, z].H[n]	:= SD * Psi ^ a;
    
    			Obj_H	:= Block (P[a, z].H[n], P[z, a].H[n], L[a, z].H[n], L[z, a].H[n]);
    		END;
    	END;
    END;
    END;
    RUN (Silver_Constant);
    

  7. Has anyone found an alternative for a - as far as I know - non-existing 3d-array?

    I'm looking for something like:

    (...)
    VAR
    : ARRAY [m..n, o..p, q..r] OF 
    BEGIN
    (...)
    

  8. Hello,

    Still trying to unraffle the Events-mysteries ...

    The famous page on the VectorLab-site shows all kind of Event-ID's in the CONST-block.

    Is there anywhere a list that sums up all these Events-ID's?

    Or are they all here?

    The VFR pages that handle Events link us back to page mentioned above, so, no help there.

    Where do these constants come from?

  9. This code does almost everything I want it do, it sets all (relevant) objects to a Sreen Objects:

    PROCEDURE SetObjToSObj;
       FUNCTION SOVB (Obj_H: HANDLE): BOOLEAN;
       BEGIN
           SetObjectVariableBoolean (Obj_H, 1160, TRUE);
       END;
    BEGIN
       ForEachObjectInLayer (SOVB, 0, 2, 0);
    END;
    RUN (SetObjToSObj);
    

    The problem is, that this code does more than I want it to: it always gives me an error message, which I understand, because a Group - for example - can't be set to a Sreen Object.

    Is there any way to avoid the error mesage?

    &

    The Traversal Option is set to the INTEGER 2, but this option doesn't seem to acces - for example - symbols.

    Is there a way to do so in this code?

  10. I think VW reserves TBdialog1 for the OK-button and TBdialog2 for the Cancel-button, by default.

    So you should start by

    CreateStaticText (TBdialog1, 3, 'Client:', 14);
    

    I've tried to change your script by doing so, but VW crashed when hitting any button.

    I guess the cause could be found in non-definition of the Ok-button and/or the Cancel-button, but I also guess that some people might cotradict this ...

    Anyway ... the code below doesn't crash, and I'm sure it's susceptible to some improvements:

    PROCEDURE TB;
    VAR
    Client, DelDate		: STRING;
    TBdialog1, Result	: LONGINT;
    
    PROCEDURE Dialog_Layout;
    BEGIN
    	TBdialog1 := CreateLayout ('Title Block Text', FALSE, 'OK', 'Cancel');
    
    	CreateStaticText (TBdialog1, 03, 'Client:', 14);
    	CreateEditText (TBdialog1, 04, '1', 53);
    	CreateStaticText (TBdialog1, 05, 'Del. Date:', 14);
    	CreateEditText (TBdialog1, 06, '2', 11);
    	CreateStaticText (TBdialog1, 07, 'Rev.:', 6);
    	CreateEditText (TBdialog1, 08, '3', 3);
    	CreateStaticText (TBdialog1, 09, 'Part`rs:', 8);
    	CreateEditText (TBdialog1, 10, '4', 43);
    	CreateStaticText (TBdialog1, 11, 'By:', 5);
    	CreateEditText (TBdialog1, 12, '5', 7);
    	CreateStaticText (TBdialog1, 13, 'Date:', 6);
    	CreateEditText (TBdialog1, 14, '6', 11);
    
    	SetFirstLayoutItem (TBdialog1, 07);
    	SetRightItem (TBdialog1, 07, 08, 0, 0);
    	SetRightItem (TBdialog1, 08, 09, 0, 0);
    	SetRightItem (TBdialog1, 09, 10, 0, 0);
    	SetRightItem (TBdialog1, 10, 11, 0, 0);
    	SetRightItem (TBdialog1, 11, 12, 0, 0);
    	SetRightItem (TBdialog1, 12, 13, 0, 0);
    	SetRightItem (TBdialog1, 13, 14, 0, 0);
    	SetBelowItem (TBdialog1, 07, 03, 0, 0);
    	SetRightItem (TBdialog1, 03, 04, 0, 0);
    	SetRightItem (TBdialog1, 04, 05, 0, 0);
    	SetRightItem (TBdialog1, 05, 06, 0, 0);
    END;
    
    PROCEDURE Dialog_Handler_1 (VAR Item: LONGINT; Data: LONGINT);
    	PROCEDURE Dialog_Events;
    	BEGIN
    		SetFocusOnItem (TBdialog1, 04);
    	END;
    
    	PROCEDURE Confirm_Events;
    	BEGIN
    		GetItemText (TBdialog1, 04, Client);
    		GetItemText (TBdialog1, 06, DelDate);
    	END;
    
    	PROCEDURE Cancel_Events;
    	BEGIN
    	END;
    BEGIN
    	CASE Item OF SetupDialogC: Dialog_Events;
    		01: Confirm_Events;
    		02: Cancel_Events;
    	END;
    END;
    
    
    BEGIN
    Dialog_Layout;
    IF VerifyLayout (TBdialog1) THEN Result := RunLayoutDialog (TBdialog1, Dialog_Handler_1);
    IF (Result = 1) THEN Message ('Client: ', Client, Chr (13), 'Delivery Date: ', DelDate);
    END;
    RUN (TB);
    

  11. Still struggling with this Python-module, but this code seems to work:

    vs. SelectAll ()
    vs. ForEachObject (vs. HMove (vs. LSActLayer (), 100, 100), vs. ObjectType (3))
    vs. DSelectAll ()
    

    or

    vs. SelectAll ()
    
    Obj_H = vs. LSActLayer ()
    Crit = vs. ObjectType (3)
    
    vs. ForEachObject (vs. HMove (Obj_H, 100, 100), Crit)
    
    vs. DSelectAll ()
    

    Edit: Seems to work for just one rectangle at the time ...

  12. Not really, no.

    However, it is possible to rotate the workplane-Z-axis,

    Exporting an empty file as a script shows me this in the code when the working plane is rotated over 45?:

    (...)
    {Layer Characteristics}
    (...)
    Projection(0,0,1239.519999999999982,-619.759999999999991,619.759999999999991,619.759999999999991,-619.759999999999991);
    SetView(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d,0,0,0);
    {End of Layer Characteristics}
    {Object Creation Code}
    SetView(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d,0,0,0);
    SetZVals(0,0);
    (...)
    

    So maybe it might be worthed looking into the SetView-parameters (?)

  13. I doubt it, works fine here with 0S X.9

    Can you find the colourpalletes in your VW-library?

    (VectorWorks 2014/Library/Defaults/Colourpalletes/*.xml-files)

    Path is translated, so it might be slightly different.

  14. There seems to be no logical structure in these Line Patterns,

    the desired pattern is located in the VW-Library under index (57);

    Once imorted it gets - following the Name2Index-command - index (9);

    To apply it in a drawing I need index (-5)

    Is there any possibility to use the name 'Type 06' for all of these indexes?

    PROCEDURE Draw_Line_Pattern;
    VAR
     Id, Num	: LONGINT;
     Obj_H 	: HANDLE;
     Patr 	: INTEGER;
    BEGIN
     PushAttrs;
    
     Id 	:= BuildResourceList (96, -14, 'Resources - Line Patterns', Num);
     Obj_H	:= ImportResourceToCurrentFile (Id, 57);
    
     Patr	:= Name2Index ('[LP] Type 06');
     Message (Patr);
    
     PenPat (-5);
     MoveTo (-500, 0);
     LineTo (500, 0);
    
     PopAttrs;
    END;
    RUN (Draw_Line_Pattern);
    

×
×
  • Create New...