Jump to content

Hippocode

Member
  • Posts

    796
  • Joined

  • Last visited

Everything posted by Hippocode

  1. I noticed some weird behaviour about special characters. PIO => POPUP PARAM values " x mm? " can be loaded into a string and made visible in the drawing. Defining a string in the PIO with concat (x,' mm?') will return another char for "?". The same string but different output. Does it depend on how I save my vss files ? (using notepad++) I tried looking up the ascii code to use with Chr instead, yet the number doesn't give the right symbol as stated in the table ?
  2. Let's say you have 2 fields to sort: 1. Create another field in the array/structure for sorting. 2. Combine the fields to be sorted with Concat(field1,field2) 3. Assign this value to the added sort field. 4. Use SortArray and sort on the added field sequence number, which is the integer needed in the function. I usually set this sorting field as the first one for easier debugging. It might also be easier to use an array of a structure rather than a multiple column array because this last one can only be one type and you typically want to capture more than one type in one row of the array such as numbers,strings, and booleans. I see what you did there. I'm now using an array of structure and managed to sort on 2 different integers, combining them into a sortfield. Str2Num(concat(field1,',',field2)); What about sorting on multiple fields being strings AND integers ? I guess I need to force zeros infront of all the numbers ugh
  3. Make sure to do both. If the type is set to dimensions, you can set 4 and 6 as values in your pio tab. If your units change, those 4 and 6 will change to match the new dimension but will keep the same width and height. You can also set the unit mark visable in the document unit settings. Its like going from 1cm to 10mm. As described above you can also force a dimension in code, by saying width:=4mm. This will force the length into 4mm, nomatter what your unit setting is, vectorworks will convert it the same way as described above. Declare the script parameter as a REAL, since 10cm => 0.1m otherwise vw will return 0.
  4. Ok well I'd like to keep it with a listbrowser. Eventually its possible to hardcode the calculated params so there is a way around it. The booleans were my own fault, didn't reset them
  5. Allright I've got 3 problems: One: the object needs to be updated AFTER I close the Listbrower. This is done trough the rotate 0 degrees and "reset on rotate". (solved) My list browser shows some paramaters that are calculated by the PIO. The list gives the option to change the subparams and i'm looking into getting the NEW calculated param into the listbrowser without hardcoding the same formula My listbrowser shows parameters that are instantly changed trough a popup. This works on everything besides booleans. The changes only get affect on closing the listbrowers, not on closing the popup. While the normal "strings/integers" are changed instantly Doesn't make sense to me. Why can't I directly update Booleans ?
  6. Sorry deleted my earlier post. I've got something weird going on that some of the data is changed right away, others after closing the listbrowser. Going to test some more before commenting
  7. Looking for a way to let a PIO recalculate itself trough another script. Yes with SetRField we can change parameters, and even "calculated parameters" but hence it would be so much easier if the last one is done by the PIO. My current workaround: Right now i've set the PIO properties to reset on rotate, in my script I let the object rotate 0 degrees, the reset works fine and for this PIO its great because I never need to rotate it. Does anyone have a better workaround ? I don't like using the rotation event
  8. SetThreeStateCheckBoxState(x,x,2) is the one I needed Atfirst I was trying to get this with the normal checkbox, believe it or not but I didn't know the "threestate" stood exactly for what I needed. Then what does SetComponentIndeterminate do?
  9. Does this also apply to checkboxes ? I've tried this function but it doesn't change the checkbox visually. To be sure we are on the same page I've added a picture of what I'm trying to achieve
  10. This is how you can approach it: PROCEDURE script PROCEDURE ChangeClasses(h:handle); BEGIN classname:=GetClass(h); IF classname = "" THEN BEGIN END ELSE IF classname = "" THEN BEGIN END; ... END; BEGIN criteria:=... FOREACHOBJECT(ChangeClasses,criteria); END;
  11. PROCEDURE SetBooleanItem( dialogID :LONGINT; componentID :LONGINT; setState :BOOLEAN); The above function gives me checkboxcontrol of 2 options being checked or unchecked. What about the third option vw uses when you edit multiple layers/classes at once while those classer/layers have different values each ?
  12. Jup, did the trick. Is there any source you know where I can find related info ?
  13. I've created a Dialog with a custom listbrowser based on the info found on Vectorlab listbrowsers. All worked well, and I've got a simple listbrowser with only static strings/images. No other options yet, an edit button will be the next thing. I would like to have an "edit" option when rightclicking/doublicking rows in that specific listbrowser, basicly I want the same options as we all have in the build-in Organisation dialog of vectorworks. Doubleclicking classes/layers gives an option to edit those selected (or clicking on the edit button). I can't find any info related to such coding. Can anyone point me in the right direction ?
  14. Hi, I'm trying to format a list with different text colours. SetLBItemTextColor Asks for a RGB color, being red, green and blue. The function ColorIndexToRGB should be able to give me these if I input the colour number from the vectorworks color palette (0-255). The problem is that the values I get are > 255 which is the maximum value the function SetLBItemTextColor accepts which I don't understand What am I doing wrong ?
  15. I'm not sure for what purpose anyone could use this feature ? I didn't know it was possible with the csv type too. I just need my data to be easily edited, which is great in excell instead of in a textfile. So you're "reading" these files in your script ? Can you also write to them row by row, column by column ? I've allready tried this, but it seems that XML can only read OR write on the network. Don't remember which one doesn't work but that stopped me from going further. Thanks for the response
  16. I'm not sure why you are using the concat function in the beginning, if you don't have to create a string from multiple strings/variables you can just define it as a string: LayBase:='X_Survey ACTIVE'; Lay1:='X_Survey Contour'; You need to do this in another way.. You script above will select all objects in that layer at once but you need to have them selected each one by one. What about this: - You go manually to the imported layer - You allready created that extra layer / script it - Trough script, you can load the current active layer and use that as search criteria to load all the drawn objects on it. Foreachobject(Checkclasses,criteria) - in this foreachloop you pass each object and load its class and compare your actions, edit the class options of that object and move/copy it to any layer you want. IF Pos('X_SUR-cont',classname) > 0 THEN BEGIN END;
  17. With script it will be much easier. That layer can be added in the search criteria for the for each loop. If the layer is variable, you just make it that the active layer becomes a part of the search criteria, giving you the choice to run your script on each sepparate layer. Also, if you let the script check if a cell in your worksheet is allready filled it can skip to the next one, not erasing previous data...
  18. That's one way, but I took the time to format my sheets in vw. Something that can't be copied into excel
  19. =DATABASE((PON='StudFrame-3D_V2') This will load all the objects that match your criteria in the database subrows. ='StudFrame-3D_V2'.'StudWidth' The above statement ( without the SUM ) will load the chosen PIO/record field values into each subrow in one column. The databaserow (not the subrow) should be showing a sum of all widths for that column
  20. While having multiple files open, vw crashes on me when I close the file that is linked trough the resourcebrowser into another file. That seems to be my only crashing problem.
  21. You forgot a ")" in your foreachobject expression ForEachObject(ExtrudeToTwelve,(INSYMBOL & (T=XTRD)));
  22. I can't really follow in adding that to the function SortArray(StructureName,handleArrayAlloc,2); It needs an integer to sort on a field, I don't see how I can sort on field 2 and 3 combined.
×
×
  • Create New...