Jump to content

matteoluigi

Member
  • Posts

    460
  • Joined

  • Last visited

Everything posted by matteoluigi

  1. Yes, I‘ve already solved that problem with three variables for one issue, the first is REAL or INTEGER, the second one is a STRING and the third one a ...CHAR variable, num2str converts my REAL or INTEGER into a STRING... works fine thanks a lot I will check out the rest tomorrow 🤗
  2. Did I understand right, that I have to pack two procedures in one script? like that:
  3. oh, excuse me, I have been translating directly from german. I want to select objects by record fields and not by their names and assign new data to other record fields. Let's say, "get me all geometry(=rectangles, polygons,...)" who match "(('Apartment',Housing'=HNr) &('Apartment',Apartmentnumber'=ANr)) and assign the values for total-nr of rooms and total area to a record field in every room-geometry of this apartment... Somehow it seems to me, that it isn't possible to assign an object to a handle which is chosen by a record field and not by its name... (and now I try to limit myself to assigning single objects to that handle 😉 ) sorry for bothering
  4. @Pat Stanford great, thank you! Now I took notice of that functions, too 😄
  5. i wrote a message to the german serviceselect-team, too 😉 so they can implement it in the german translation, at least
  6. sorry, but, then the tooltip in the worksheet-functions-window is bad. (or maybe it's the translator's fault? I don't know) 😉
  7. Hi, sorry for bothering again 😉 but, you have been really of help!!! thanks a lot! i want to assign data to record fields of more objects. Is this possible? Or am I right when I say, that: - I can assign only one single object to a handle - I can only assign an object to a handle by its (in the Vectorworks-file) unique name? I`d prefer selecting more objects by database attributes and assign the data simultaneously to more than one object... Somehow I think, that I want to much, now. 😔 Do I? Thanks for you great help, anyway!
  8. 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.
  9. And Num2Str also does work with Integer instead of Real variables.
  10. 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);
  11. Num2Str should do it with EINZW as REAL Number...
  12. 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);
  13. 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")
  14. 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);
  15. @Pat Stanford does there also exist sth like else if?
  16. thanks for your great help. Where can I find instructions how to use an if-clause in vectorscript?
  17. @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)
  18. sure, that's right... (as a counter it should be supposed to be an INTEGER Number of course... 😉 ) thanks 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 🙂
  19. 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. 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: 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
×
×
  • Create New...