Jump to content

matteoluigi

Member
  • Posts

    177
  • Joined

  • Last visited

Posts posted by matteoluigi

  1. Sometimes there are missing things in Vectorworks which are really elementary... like having a doorbell at home without a button at the entrance-door for ringing... nearly.

     

    Actually I'm wondering again, what the worksheet-"sum" function really is for, when it's just for adding more variables one to the other instead of calculating a sum of a defined area.

    In Excel the function does look the following way: "SUM(A1:A20)" and it does create a sum from the complete cell-content from cell "A1" to cell "A20".

    (https://support.microsoft.com/en-us/office/sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89)

    could be a greatnew feature for Vectorworks 2022

     

    Maybe people don't need it very often, but, when you need this function, you really miss it.

  2. Is it really necessary, to create a new worksheet, everytime I run the script again?

     

    a) or can I "assign the worksheet to the handle in another way, too? (still looking for the way)

     

    b) is there any way, to check, wether a worksheet of a specific name already exists in the file?

     

    worksheet := CreateWS('Wohnungstypen-Auto', 5, 2);

     

    SetWSCellFormulaN(worksheet, zeile, 1, zeile, 1, inString);

  3. works nearly fine, however SetWSCellFormulaN only works with Strings or Char - Variables.

    I'd like to insert an Integer-Value.

     

    How could I do that? Is there any possibility to transform an Integer-Value into a String? Or feed a String-Variable with Integer-content?

     

    EINZW: INTEGER;

     

        inString := EINZW;          
        SetWSCellFormulaN(worksheet, zeile, 2, zeile, 2, inString);

     

     

  4. Hi,

     

    does there exist any possibility to write data from a Vectorscript-Script directly into an existing Vectorworks-worksheet?

     

    I didn't find a corresponding command. (maybe because the command doesn't exist)

     

    Alternative would be using "runscript" directly from the worksheet.

     

    Therefor I need to read out column A and insert it as variable in the script.

    (For example - A1: 1 -> "there are x 1-room-apartments")

     

  5. yeah, thanks, I got it all running, now 🙂

     

    Now I would like, to write my results in a worksheet.

     

    Still working on it (and maybe thinking about running the script within a worksheet)

     

    {In this script, I count
    
    a) how many objects are connected with the database "Wohnungsnummer" (number of flat/apartment)
    b) in a for to loop i do loop through all apartments (in fact the loop runs as often as many rooms are in the building, not as many apartments, but, that's not my main priority)
    
    - every loop the script counts the number of rooms which are living rooms, rooms or workrooms (it's the way you define flats in germany, a 3 room flat for example consists of a kitchen, a bathroom, a corridor, a living room and two sleeping rooms, you only count the living room and both sleeping rooms)}
    
    PROCEDURE zaehlen;
    
    VAR
    NR:			INTEGER;	{counter for the running loop}
    ANZAHL:		INTEGER;	{number of all rooms}
    ZANZAHL:	INTEGER;	{number of rooms of the actually checked apartment}
    EINZW:		INTEGER;	{number of all 1 room-appartments}
    ZWEIZW:		INTEGER;	{number of all 2 room-appartments}
    DREIZW:		INTEGER;	{number of all 3 room-appartments}
    VIERZW:		INTEGER;	{number of all 4 room-appartments}
    FUENFZW:	INTEGER;	{number of all 5 room-appartments}
    
    BEGIN
    ANZAHL := COUNT(((('Wohnung'.'Zimmertyp'='Zimmer')|('Wohnung'.'Zimmertyp'='Wohnen')|('Wohnung'.'Zimmertyp'='Arbeitszimmer'))));
    
    {EINZW :=0;
    ZWEIZW :=0;
    DREIZW :=0;
    VIERZW :=0;
    FUENFZW :=0;}
    
    FOR NR:=1 TO ANZAHL DO BEGIN	{Schleife, die alle Wohnungen "durchläuft" }
    
    ZANZAHL := COUNT(((('Wohnung'.'Whg-Nr'=NR) & (('Wohnung'.'Zimmertyp'='Zimmer') | ('Wohnung'.'Zimmertyp'='Arbeitszimmer') | ('Wohnung'.'Zimmertyp'='Wohnen')))));
    	{Zählt, wieviele Zimmerin der Wohnung sind mit der Wohnungsnummer NR.}
    
    IF (ZAnzahl=1) 	{erhöht den Einzimmerwohnungs-Zähler um 1, wenn die Whg ein Zimmer hat.}
    THEN
    BEGIN
    EINZW := EINZW+1;
    END;
    
    IF (ZAnzahl=2)		{erhöht den Zweizimmerwohnungs-Zähler um 1, wenn die Whg ein Zimmer hat.}
    THEN
    BEGIN
    ZWEIZW := ZWEIZW+1;
    END;
    
    
    IF (ZAnzahl=3)		{erhöht den Dreizimmerwohnungs-Zähler um 1, wenn die Whg ein Zimmer hat.}
    THEN
    BEGIN
    DREIZW := DREIZW+1;
    END;
    
    IF (ZAnzahl=4)		{erhöht den Vierzimmerwohnungs-Zähler um 1, wenn die Whg ein Zimmer hat.}
    THEN
    BEGIN
    VIERZW := VIERZW+1;
    END;
    
    IF (ZAnzahl=5)		{erhöht den Fünfzimmerwohnungs-Zähler um 1, wenn die Whg ein Zimmer hat.}
    THEN
    BEGIN
    FUENFZW := FUENFZW+1;
    END;
    
    END;
    
    
    CreateText(Concat('Da sind ', EINZW, ' Einzimmerwohnungen, ', ZWEIZW, ' Zweizimmerwohnungen, ', DREIZW, ' Dreizimmerwohnungen ', VIERZW, ' Vierzimmerwohnungen und ', FUENFZW, ' Fünfzimmerwohnungen.'));
    
    
    AlrtDialog(Concat('Da sind ', EINZW, ' Einzimmerwohnungen, ', ZWEIZW, ' Zweizimmerwohnungen, ', DREIZW, ' Dreizimmerwohnungen ', VIERZW, ' Vierzimmerwohnungen und ', FUENFZW, ' Fünfzimmerwohnungen.'));
    		{Gibt aus, wieviele Wohnungen welchen Typs im Haus sind.}
    END;
    RUN(zaehlen);

     

    • Like 1
  6. Quote

    IF COUNT((R IN ['Wohnung']) & ('Wohnung'.'Whg-Nr'=NR) & ('Wohnung'.'Zimmertyp'='Wohnen') | ('Wohnung'.'Zimmertyp'='Zimmer') | (('Wohnung'.'Zimmertyp'='Arbeitszimmer'))=1) THEN EINZW := EINZW+1;
    IF COUNT((R IN ['Wohnung']) & ('Wohnung'.'Whg-Nr'=NR) & ('Wohnung'.'Zimmertyp'='Wohnen') | ('Wohnung'.'Zimmertyp'='Zimmer') | (('Wohnung'.'Zimmertyp'='Arbeitszimmer'))=1) THEN ZWEIZW := ZWEIZW+1;
    IF COUNT((R IN ['Wohnung']) & ('Wohnung'.'Whg-Nr'=NR) & ('Wohnung'.'Zimmertyp'='Wohnen') | ('Wohnung'.'Zimmertyp'='Zimmer') | (('Wohnung'.'Zimmertyp'='Arbeitszimmer'))=1) THEN DREIZW := DREIZW+1;
    IF COUNT((R IN ['Wohnung']) & ('Wohnung'.'Whg-Nr'=NR) & ('Wohnung'.'Zimmertyp'='Wohnen') | ('Wohnung'.'Zimmertyp'='Zimmer') | (('Wohnung'.'Zimmertyp'='Arbeitszimmer'))=1) THEN VIERZW := VIERZW+1;
    IF COUNT((R IN ['Wohnung']) & ('Wohnung'.'Whg-Nr'=NR) & ('Wohnung'.'Zimmertyp'='Wohnen') | ('Wohnung'.'Zimmertyp'='Zimmer') | (('Wohnung'.'Zimmertyp'='Arbeitszimmer'))=1) THEN FUENFZW := FUENFZW+1

     

    however doesn't work

  7. @JBenghiat yeah, herbieherb already told me in the german user board 😉 I think about it. first i thought, I would feel more familiar with vector script, because I already have been coding in Vectorworks worksheets for a couple of years... however, just putting a "vs" in front is ok for coding python.

     

    great alternative, i guess, and of course keeping in mind that with marionette there exists a third alternative (which also includes python codes in its nodes)

  8. 6 minutes ago, Julian Carr said:

    1. N should be an integer not a string.

    sure, that's right... (as a counter it should be supposed to be an INTEGER Number of course... 😉 ) thanks

     

    6 minutes ago, Julian Carr said:

    2. AlrtDialog cannot be used as a string because it is a reserved word being a procedure.

     

    in https://developer.vectorworks.net/index.php/VS:AlertInform is written:

     

    text.              STRING      The information to be displayed.

    advice          STRING      The text to be added in a smaller font under the main information message.

    minorAlert   BOOLEAN  The severity of the alert: minor(true) or major(false).

     

    however, thanks 🙂

  9. Hi,

     

    I want to learn Vectorscript and actually not that bad (i think at all). I already have been coding a little bit C, C++, Basic, Pascal and PHP in my life (also it's 15 years ago 😉 ) but, however, I know a little bit about functions, procedures, variables, variable types... my skills only got a bit rusty. However I also did work in Vectorworks worksheets and regained a part of my forgotten skills, somehow.

     

    Actually I am struggling with some basics and sometimes I don't understand, what the compiler really wants to tell me...

    (PLEASE don't tell me, I could solve the issue of the script with a worksheet more easily... It's just a first try, let's say, a proof of coding skills.

     

    Quote

    PROCEDURE counter;

    VAR
    N:            STRING;
    AlrtDialog:    STRING;
    text:        STRING;
    advice:        STRING;
    minorAlert:    BOOLEAN;

    BEGIN

    N :=Count(R IN ['Wohnung']);

    AlrtDialog('AlrtDialog');
    AlertInform('AlertInform', 'advice', FALSE);
    AlertCritical('AlertCritical', 'advice');
    Message(YNDialog('YNDialog'));
    Message(AlertQuestion('question', 'advice', 1, 'ok', 'cancel', 'a', 'b'));

    END;      
    RUN(counter);

     

     what's wrong with that code??

     

    Line #10 BEGIN

     

         {Error: Expected BEGIN}

         {Error: Expected a RUN statement at the end of the script}

         There's a "RUN statement at the end of that script...

     

    Line #14 AlrtDialog('AlrtDialog');

         { Error: Expected a string or char. }

    or

         { Error: Expected the assignment operator := }     

    or

       { Error: Dod not expect this after end of statement - missing ;?  } 

     

    I mean, c'mon, I am copying the commands from the developer-wiki and still they are wrong?

     

    What's wrong about:

    Quote

    PROCEDURE counter;

    VAR
    {Variables}

    BEGIN

    {Code}

    END;      
    RUN(counter);

      There's the "PROCEDURE"-command and name in the beginning.

    followed by "BEGIN", "END;" and "RUN"(Name)

     

    sometimes I think compilers must be female... I don't understand them 

  10. On 8/6/2020 at 5:52 PM, Pat Stanford said:

    There was a discussion of the OIP being completely empty. Wish I could think of what phrase the poster used.

    hmm, but, the empty OIP-Problem isn't a well known issue at VW inc.? I am wondering, because it's happening so regularly, independently of any file. Resetting the user folder helped only for some days... strange thing.

  11. For drawing plans for modification of buildings, data Data visualization should be able to hide objects, too. In Archicad for example it's called Rennovation filter. Here you can assign to an object, wether it is existing, new or should be demolished, in order to display all parts in the colors - black:existing, yellow: demolished, red: new or display only the old version or the new version of the building.

    However, data visualization actually isn't able to hide objects, which is essential for those plans.

     

    Here you can see, how it is solved in Archicad:

     is

    • Like 1
  12. On 8/29/2011 at 5:25 PM, Matt Panzer said:

    ...still working on it..

    --------------------------

    PROCEDURE MAIN;

    CONST

    kVisible = 0;

    kHidden = -1;

    kGreyed = 2;

    VAR

    i : INTEGER;

    BEGIN

    FOR i := 2 TO ClassNum DO BEGIN

    CASE GetCVis(ClassList(i)) OF

    kVisible: HideClass(ClassList(i));

    kHidden: ShowClass(ClassList(i));

    kGreyed: {do nothing};

    END; {CASE}

    END;

    END;

    RUN (MAIN);

    -----------------------------------------------

    HTH,

    great thing, however, somethings not working in the script. What's wrong with the quoted script aheada?

×
×
  • Create New...