Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

186 Spectacular


About MullinRJ

  • Rank
    1000 Club

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    United States

Recent Profile Visitors

1,867 profile views
  1. Hi Julian, Here's one for lower case. PROCEDURE TEST; CONST CR = chr(13); VAR S :String; function LowerCase(S :String) :String; { Convert string S to lower case. } Var Ch :Char; I, StrLen, ChVal :Integer; T :String; Begin T := ''; StrLen := len(S); for I := 1 to StrLen do begin Ch := copy(S, I, 1); ChVal := ord(Ch); if (ChVal > 64) & (ChVal < 91) then T := concat(T, chr(ChVal+32)) else T := concat(T, Ch); end; { for } LowerCase := T; End; { LowerCase } BEGIN S := '0123456789 !@#$%^&*()_+ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'; message(S, CR, LowerCase(S)); END; Run(TEST); Raymond
  2. Thanks, Josh. I do miss those days and the mailing lists. Raymond
  3. Hi Josh, In all the documentation I've got (limited as it may be), I've never seen an ObjVar in the 9000 range. Is there anything online with that info, or do tap into guru's in the factory? TIA, Raymond
  4. Good morning, @Pat Stanford . Yes. You, me, and _c_, (and Tui). I just reread the thread and at the end I wrote that it works in VW 2020, but not in earlier VW versions. Also, you cannot export a VW 2020 file back to earlier versions with a popup field defined. Well, you can, but the popup field type will not work anymore. So, @Jesse Cogswell , the question to you is, "What version of VW are you using?" Raymond PS - Thanks for the memory jog, Pat. I'd almost forgotten about that issue.
  5. Hi David, Yes, I have seen the 6 digit rounding when using Python for PIOs. The OIP will display 10 digits, and VS functions like Concat(pRealPIOParam) will display 15 decimal places when they convert Reals to Strings. Example from a VS PIO script I am currently working on showing 15 significant digits: ControlPoint01X= 0 ControlPoint01Y= 15.8676746286034 ControlPoint02X= 0 ControlPoint02Y= 26.1038951010443 I do not have a workaround for Python. Perhaps someone else does. Raymond
  6. Hi David, I think it's a "feature" of Python, and not a limitation of VW. In VectorScript you get 15 decimals displayed for REALS. Is there a way to declare your variables as double precision REALS before you use them? If so, I'm not sure how you would do that for Control Point variables in a PIO. Raymond
  7. The Script Function Reference can be found in your VW application VWHelp folder undoer VWHelp > Script Reference. The same documentation is also available online at https://forum.vectorworks.net/index.php?/announcement/14-developer-wiki-and-function-reference-links/ HTH, Raymond
  8. Just for variety, here is a vector approach to do the same thing. It's just a little more code than Julian's scaling approach, and to the original request it will increment every line on visible layers. If you want the script to only work on the Active Layer, then change the last "2" to a "0" in the following line: ForEachObjectInLayer(GrowLine, 0, 0, 2); { All objects, Shallow, Visible layers } ForEachObjectInLayer(GrowLine, 0, 0, 0); { All objects, Shallow, Current layer } Procedure GrowLinesByInc; { Grow each line on visible layers by a user input length. If the user input is positive } { the line length increases, if it is negative, the line length decreases. } VAR dLength : REAL; function GrowLine(H :Handle) :Boolean; { Use global variable "dLength" to calculate a vector in the same direction } { of each line and add half of it to each end. } Var P1, P2, Vdelta :Vector; Begin if (GetTypeN(H) = 2) then begin { type 2 is a LINE } GetSegPt1(H, P1.x, P1.y); { start point of line } GetSegPt2(H, P2.x, P2.y); { stop point of line } Vdelta := UnitVec(P2 - P1) * dLength/2; P1 := P1 - Vdelta; { move away from center } P2 := P2 + Vdelta; { move away from center } SetSegPt1(H, P1.x, P1.y); { new start point of line } SetSegPt2(H, P2.x, P2.y); { new stop point of line } end; { if } end; { GrowLine } BEGIN dLength := RealDialog('Length increment?', '0'); if not DidCancel do ForEachObjectInLayer(GrowLine, 0, 0, 2); { All objects, Shallow, Visible layers } END; Run(GrowLinesByInc); Raymond
  9. If there's no way to add a 3D fillet by script, you can always do a solid subtraction. Yes, it's a lot more work, but it is doable for simple shapes. Raymond
  10. Hi Julian, That is not what I was hoping for. CreateControl(), option 2, creates a button to select a color from a system color palette. I was hoping to set the color of a PushButton, so I guess I mis-interpreted the function's use. Thank you for clarifying it. Raymond
  11. It is my understanding, flawed as it is, that "vst" commands apply to TOOLS, where "vso" commands apply to OBJECTS. There may be some crossover, so like Sam, I await someone else's answer. Raymond
  12. Has anyone ever gotten SetColorButton() to work? It is advertised as being introduced in VW 9.0, but I could not get it to affect a color change on a Modern Dialog PushButton in VW 2019, VW2014, or VW 2009, which is as far back as I can test without switching computers. Is it designed to work on a different kind of control? Documentation is sparse in both the HTML Script Function Reference and the online Developer's WIKI. If no one answers to the affirmative in a day I'll file a bug. Thank you, Raymond
  13. So, what types are the objects? Place this just before or after the SubtractSolid() command. AlrtDialog(concat( bigObject, ' ', GetTypeN(bigObject), chr(13), smallObject, ' ', GetTypeN(smallObject) )); Are they what you think they are? If so, then I got nuttin' without seeing some code. Raymond
  14. Have you verified your handles are correct inside the PIO? Without seeing any code that is my only guess. Raymond
  15. Hi @Jiajing , I just did some quick testing of your script. There are some side effects you need to be aware of. Short answer: vs.ForEachObjectInList() and ForEachObject() work differently. The first procedure walks through a list of handles where you supply the first object in the list. The second procedure walks through every object in the drawing. You change the selection state when you hide or gray objects by changing their class visibilities. I am assuming that is what you are doing. Your use of vs.ForEachObjectInList(AssignClass, 2, 2, vs.FInGroup(vs.GetParent(Dummy))) uses option 2, 2 which means Selected and Deep. If your group objects are grayed because they are in a Hidden Class they become unselected. Your script is using the SEL criteria to process objects, so unselected objects will not be processed as you walk through the list. If your groups are grayed another way, you'll have to see if this is still true. Notice your LW and color are set because ForEachObject() works differently from vs.ForEachObjectInList() and does not need the outer group to be selected to see selected objects inside that are selected. If you change your settings to vs.ForEachObjectInList(AssignClass, 0, 2, vs.FInGroup(vs.GetParent(Dummy)) you can enter grayed groups. This may not work exactly as you'd like so you may have to play with it. HTH, Raymond


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...