Jump to content

Thomas W

Member
  • Posts

    100
  • Joined

  • Last visited

Everything posted by Thomas W

  1. Maybe the "Use real dimensions" of the Panel info Object option?
  2. Rest In Peace Niklaus Wirth. I started my first VectorScript exercises a little over a year ago thanks to you and this forum and I am very happy to have done it! I hadn't done any programming before (apart from a week of Basic on MO5 in 1985!) and I really found this structured programming interesting and instructive. The fact that this language from the 1970s is still used surely says a lot about its creation and its creator, thank you to him and long life to its language.
  3. Hi, Ok, I modified the script to look up the coordinates of the arrowhead from the "Legend" function using GetSymLoc, the length of the guideline and the angle. Below is the script and an attached vwx file. If you have any comments on the size obtained from the bounding box of the 1st message or to improve the script below I would be grateful: I changed the {} to () of the return cart so that it works... PROCEDURE GetArrowHeadCoordinateFromLegend; CONST CR = Chr{13}; VAR h, recHand :HANDLE; recName, fldName, fldNameLength, LineLengthString :STRING; angleR, LineLengthNum, AHx, AHy :REAL; { AHx, AHy : coordinates of the ArrowHead of the legend } InsPt, Line :POINT; BEGIN h := FSActLayer; IF GetTypeN(h) = 86 THEN { Returns the type index of the referenced planar or screen object - vérifie si type plug-in } BEGIN recHand := GetParametricRecord(h); { Returns the handle to the parametric record attached the referenced object } recName := GetName(recHand); { Name of record format } fldNameLength := GetFldName(recHand, 11); { Returns the name of the field "11" in the referenced record } LineLengthString := GetRField(h, recName, fldNameLength); { Returns string description of a value in the specified record field } { Function ValidNumStr returns TRUE if the specified string can be converted into a numeric value } { If TRUE, the numeric value is returned } IF ValidNumStr(LineLengthString, LineLengthNum) THEN { Cf Help : If you need to know whether or not the FUNCTION succeeded, you shouldn't be using Str2Num, but ValidNumStr instead.} BEGIN angleR := HAngle(h); { Function HAngle returns the angle of the referenced object - ici en degrés comme dans OIP } GetSymLoc(h, InsPt.x, InsPt.y); { Procedure GetSymLoc returns the insertion point of the referenced symbol or plug-in object } { AlrtDialog(Concat( 'Le point d''insertion est au point de coordonnées : ', CR, 'InsPt.x = ', InsPt.x, CR, 'InsPt.y = ', InsPt.y)); } Line.x := LineLengthNum * Cos(Deg2Rad(angleR)); Line.y := LineLengthNum * Sin(Deg2Rad(angleR)); { AlrtDialog(Concat('La distance entre GetSymLoc et la pointe de la flèche est de : ', CR, 'Line.x = ', Line.x, CR, 'Line.y = ', Line.y)); } AHx := Trunc((InsPt.x + Line.x)*1000)/1000; AHy := Trunc((InsPt.y + Line.y)*1000)/1000; AlrtDialog(Concat( 'Les coordonnées de la pointe de la flèche sont : ', CR, 'AHx = ', AHx, CR, 'AHy = ', AHy)); END ELSE AlrtDialog(Concat('The specified string can not be converted into a numeric value')); END; { IF ValidNumStr } END; Run(GetArrowHeadCoordinateFromLegend); Thanks in advance! GetBBox with Légende.vwx
  4. HI, Sorry but I just realized that there is an error in the script that looks for the coordinates of the arrowhead. Surely a problem of converts with the Ang2Vec function towards Cartesian coordinates, I try to correct it and I come back ...
  5. Hi all, I am working on a French version so to avoid errors in translating the names of the functions you will see in the screenshot below the "Legend" function that I am talking about which is different from the Callout (Infobulle) and Keynote (Légende) functions, sorry but I couldn't find the English name of this function 🤔 ! I was looking for the coordinates of the arrowhead of this Legend function that my colleagues have been using for a while, so I first tried to get the bounding box using GetBBox but the box is much larger than the object : 1- Do you know why the coordinates retrieved by GetBBox exceed the object so much? I haven't found any logical reasoning between the bounding box and the object, anyone know more about this? It's not blocking for me but I would like to understand why the box is so big. Attached is a capture and a file in 2023. Otherwise to find the coordinates of the tip of the arrow I made a script by looking for the length of the guideline in the parametric record, the angle and GetSymLoc. The script is in the vwx files, if you have any comments, advice or improvements it will be with pleasure! (if I paste the code I get a 403 error even if I change Chr to CHR) Thanks and have a nice day, Thomas GetBBox with Légende.vwx
  6. Hi, Ok, I tested the Vectorworks Cloud Service and it works fine as you described above. I should have been more precise in my first post by asking: will a plug-in always have to be installed on each workstation here: C:\Users\Name\AppData\Roaming\Nemetschek\Vectorworks\2023\FRA\Plug-ins? I think the answer is yes so sharing will allow each user to download and install it on their computer, I was wondering if there was another way to share a plug-in to avoid each user installing it on his post. We currently share a library by sharing a folder without going through Vectorworks Cloud Service but this solution would surely allow better management of updates. Thank you for this information and have a nice day!
  7. Hi @BartHays, Thank you for your response and your explanations! I am going to create a Workgroup Library Folder in our Vectorworks Cloud Service folder since we are not using it at the moment. I'll test this today or tomorrow and let you know if it works for us. Have you ever managed to share a Plug-in without going through Vectorworks Cloud Service? Just with a shared folder on a server and a library structure? Thank you and I will test the Vectorworks Cloud Service!
  8. Hi all, Does anyone know how to share plugins (.vso) with a shared library? This is to avoid copying the plug-in to each workstation here: C:\Users\Name\AppData\Roaming\Nemetschek\Vectorworks\2023\FRA\Plug-ins ... and to manage updates. According to the description and help capture below it is possible: https://help.designexpress.eu/vwhelp/2023/FR/VW2023_Guide/Workgroup/Sharing_custom_content_using_workgroup_folders.htm?rhsearch=partager plug in&rhpgno=2 Ci-dessous le chemin que j'ai testé mais qui n'a pas fonctionné : Do you know if this can work? Thanks and have a great day, Thomas
  9. Hi @BillW, Thanks for the update and this information! In France we are currently on version 2023 SP6, so I would use it as soon as version 2024 is available. Thank you and have a nice day
  10. @BillW The installation of the whole thing went very well following your pdf file and the auto-completion plus the advantages of snippet codes and quicktext is really a plus! I haven't tried Python scripting because I don't have enough knowledge in this language but the possibilities look interesting. Thanks again for sharing!
  11. Thanks a lot for sharing and the work that it represents! I will test as soon as possible and get back to you
  12. Hi, I received feedback from one of the developers at Vectorworks Inc. I am sending you an extract that may be of interest to some user : " The scripts as cell formulas should only calculate the value of this cell. If it is more complicated script that works on the entire worksheet should be a separate script in prinzip. " I solved the problems visible above by removing the script that was executed with the Runscript function and I compiled everything into a script that is executed by double clicking on it. The original goal was to put the script in a cell so that it would run whenever the user updates the spreadsheet, but this apparently isn't appropriate. Good day to all!
  13. Hi, I got feedback from the hotline who managed to reproduce the problem without really knowing why it failed. For them it looks like a bug which could perhaps come from the numerous alert messages which interrupt during the execution of the script. There could also be a problem when multiple WS scripts run while one is still running. They'll pass it on to the developers at Vectorworks Inc. and I'll let you know if I get a response. Have a great day !
  14. Thank you for sharing @BillW! With these two files and the language set to Pascal it's a helper that works just fine,thanks!
  15. @Martin DE Thank you for this information! I downloaded your .xml version of the vectcorscript functions and copied it to C:\Program Files (x86)\Notepad++\autoCompletion and it works fine, it offers me the vectorscript functions that are available in your file. And the Pascal language defines for syntax highlighting also helps a lot. I was just wondering if there are new vectorscript functions do you update it yourself manually or point to an original Vector file that contains all the functions? @Martin DE and @Patrick Stanford In any case, thank you for all this useful information and have a nice day!
  16. Merci, je vais déjà tester avec {$DEBUG} et les fichiers d'inclusions .vs Oui je suis sous Windows, pour mon information dans BBEdit vous pouvez inclure un fichier comme vs.py mais en Pascal?
  17. Thanks for the clarification Pat, They did say "can be encrypted" but I preferred to ask. If you have a script that exceeds the script editor's character limit what would you recommend to still benefit from Vectorworks' script editor error finding?
  18. Ok sorry I found for question 3-: It's specified in the VectorScriptGuide.pdf : https://developer.vectorworks.net/images/7/72/VectorScriptGuide.pdf Example: Windows-style include directive {$INCLUDE MyHD\Vectorworks\Projects\VS\mycode\math.vss} Include files specified without any path information are assumed to reside in a predefined default path relative to the script. For document scripts and scripts run from text files, the default path is the location of the Vectorworks application. For plug-ins, the default path is assumed to be the folder where the associated plug-in is located. So putting the myinclude.vss file here; C:\Program Files\Vectorworks 2023 FR it works...with {$INCLUDE myinclude.vss} without specifying the exact path.
  19. Hi all, I'm writing a script and before cleaning it I reached the character limit that Vector's script editor accepts, so I'm testing the include files (even if after cleaning the script will be shorter (this is a method I wanted to test). I looked at the examples that are here : https://developer.vectorworks.net/index.php/VS:Include_Files_and_Encryption#See_Also And I have a few questions: 1- The unencrypted include files will be in .vss format and the encrypted ones will be in .px format, right? 2- Is it adding a .px extension to the include file that will encrypt the include file and the script? (extract : "Alternatively, include files can be encrypted along with the script which calls them by appending a .px extension to the name of the include file.") On the https page above it has the example below: in the include file myinclude.vss : PROCEDURE Remote_Sub; VAR j:INTEGER; BEGIN AlrtDialog('This is the include function'); END; and the calling script : PROCEDURE EncryptExample1; VAR i:INTEGER; s:STRING; {$INCLUDE myinclude.vss} BEGIN Remote_Sub; END; RUN(EncryptExample1); 3- I got it to work by specifying the exact path of type Y:\Thomas\VectorScript\TW VS Include script files with INCLUDE\myinclude.vss Is it possible to make it work without specifying the exact path as in the example? Or is it always an absolute or relative path? I tried by copying myinclude.vss to the default path shown in Script Options in the Script Editor: C:\Users\t.wanner\AppData\Roaming\Nemetschek\Vectorworks\2023\FRA\Plug-ins\Marionette but without success. If you have any advice on this, they would be welcome! Have a great day
  20. tested! Thanks it works very well, it was exactly what I was looking for!
  21. Thank you very much Kevin! I will test this right away!
  22. Hi all, I wanted to know if there was a function that would display the execution time of a script, a bit like what is displayed at the bottom left when there is a script error, visible on the screenshot below -below. I searched here but couldn't find anything : https://developer.vectorworks.net/index.php/VS:Function_Reference Thanks and have a great day!
  23. Cool! Yes you can change the names of the worksheets in the script. The script will fetch sub rows from the database which is on line 4 and defined in the script as DatabaseRow1 := 4, in case you can change that too. When you say automate these scripts would it be that the 'Schlosserei V100 Data' table is recalculated as soon as 'Schlosserei V100' is modified? If that's it I think it's doable but I wouldn't have time to look for the necessary functions and maybe not all the skills, you really have to know your operation well so that there is no problem. command errors. If you are interested, you can already read the explanations of these functions used in this script and it may make you want to go further! https://developer.vectorworks.net/index.php/VS:GetWSSubrowCellStrN https://developer.vectorworks.net/index.php/VS:SetWSCellFormulaN Happy already that it works like that and good use!
  24. Hi Pat, No worries and thanks for trying again, I'll send it to the hotline, in the meantime we'll run the script from the manager, it'll work fine that way too! I'll report back when I get a response from the hotline. Have a great day, Thomas
×
×
  • Create New...