Jump to content

MullinRJ

Member
  • Posts

    2,024
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. I've always used Cut, then Paste-in-Place (Cmd-X, Cmd-Option-V). Raymond
  2. Boh, There may be a more elegant way to remove the Attributes-By-Class setting for selected objects, but I can't find it. I can only do it by removing each attribute individually. Here's a script to that effect. This will work on multiple selected symbols, but not on nested symbols. If a symbol definition contains other symbol instancess, they will not be affected. You will have to run this script on instances of each symbol you want to convert. You can place them in the drawing, select them all, then run the script once. After this script is run, you will not see any differences in the symbol's appearance. The objects inside will have the same attributes as the classes they are in. However, if you then change the appearance of a controlling class, these symbols will not follow the new class appearance since their contents no longer are set By-Class. I hope this is what you were looking for. Raymond Procedure SymbolContentsNotByClass; { If the selected objects in a drawing are symbols, this script locates } { each symbol definition and converts all objects inside the definition } { to REMOVE the SetByClass option for all attributes. } { 21 December 2017 - Raymond Mullin } { This has been less than lightly tested. Pat Stanford recommends you use } { this on a copy of your primary file. No warranty expressed or implied. } { Use at your own risk. Do not operate heavy machinery while using this script. } { I concur. } VAR SymH, H: Handle; B, visibility :Boolean; thickBasis, angul, Opacity, PenOp, FillOp :Integer; style, Red, Grn, Blu :Longint; size, wydth, thickness :Real; BEGIN SymH := FSActLayer; while (SymH <> Nil) do begin if (GetTypeN(SymH) = 15) then begin { if it is a Symbol } H := FinSymDef(GetObject(GetSymName(SymH))); while (H <> Nil) do begin SetLW(H, GetLW(H)); SetLSN(H, GetLSN(H)); GetPenFore(H, Red, Grn, Blu); SetPenFore(H, Red, Grn, Blu); GetPenBack(H, Red, Grn, Blu); SetPenBack(H, Red, Grn, Blu); SetFPat(H, GetFPat(H)); GetFillFore(H, Red, Grn, Blu); SetFillFore(H, Red, Grn, Blu); GetFillBack(H, Red, Grn, Blu); SetFillBack(H, Red, Grn, Blu); if GetObjBeginningMarker(H, style, angul, size, wydth, thickBasis, thickness, visibility) then B := SetObjBeginningMarker(H, style, angul, size, wydth, thickBasis, thickness, visibility); if GetObjEndMarker(H, style, angul, size, wydth, thickBasis, thickness, visibility) then B := SetObjEndMarker(H, style, angul, size, wydth, thickBasis, thickness, visibility); { For VW 2016 and earlier, use the following for Opacity: } GetOpacity(H, Opacity); SetOpacity(H, Opacity); { For VW 2017 and later, use the following for Opacity: } { if GetOpacityN(H, PenOp, FillOp) then B := SetOpacityN(H, PenOp, FillOp); } H := NextObj(H); end; { while (H <> Nil) } ResetObject(SymH); end; { if } SymH := NextSObj(SymH); end; { while (SymH <> Nil) } RedrawAll; END; Run(SymbolContentsNotByClass);
  3. T, you are very welcome. One way to learn how the calls are organized is to view the DevWiki or the HTML (on your computer) references using the "View By Class" link (see pic). This will allow you to ignore the majority of calls that probably don't relate to the problem you are interested in solving. With more than 2600 VS calls, filters are highly recommended. Also, keep writing back. Someone is always awake and ready to answer questions. All the best, Raymond
  4. T, Here's an example of a short script using a pre-defined String Dialog to get you started. Modify to your heart's content. PROCEDURE abc; VAR default, result :STRING; BEGIN default := ''; result := StrDialog('Enter Leader text...', default); if not DidCancel then begin DSelectAll; SelectObj( INSYMBOL & INVIEWPORT & (PON='ID Leader') & ('ID Leader'.'TagText' = result) ); end; { if } END; Run(abc); It should read fairly straightforward, except for "DidCancel". Consider "DidCancel" as a global variable that is set to TRUE when a user closes a standard dialog box by pressing the OK button, and is set to FALSE when a user presses the CANCEL button. Word of future caution, don't use the word "DidCancel" as one of your variable or procedure names. ;-O HTH, Raymond
  5. I don't mind at all. Add away. One thing to keep in mind, this conversion ratio works for a single curve segment, as a Circle, Arc, or Oval. For complex (multiple) curves, like those existing in a Polyline or Rounded Rectangle, the number of segments created using this relation is per curve. Raymond
  6. Patrick, The resolution number is not linear, but makes transitions at powers of 2. The number of sides generated is also a power of 2. Conversion resolutions of: 0-7 yield 2 sides; 8-15 yield 4 sides; 16-31 yield 8 sides; 32-63 yield 16 sides; etc., up to 512 which yields 256 sides. Values higher than 512 all yield 256 sides. HTH, Raymond
  7. Roly, Try this link instead: http://www.vectorworks.net/support/downloads/product-updates HTH, Raymond
  8. Sam, Was this of any help to you? Have you tried it yet? No hurry, just curious. Raymond
  9. There are 3 characters to be aware of when typing "dashes": - Hyphen (also called Dash or Minus Sign), – en dash, and — em dash. In Western Mac OS encoding (single byte characters): Hyphen, ASCII 45, Hex(2D), Hyphen key en dash, ASCII 208, Hex(D0), Option-Hyphen key em dash, ASCII 209, Hex(D1), Shift-Option-Hyphen key In Western Windows Latin 1 encoding (single byte characters): Hyphen, ASCII 45, Hex(2D), Hyphen key en dash, ASCII 150, Hex(96), type Alt-0150 em dash, ASCII 151, Hex(97), type Alt-0151 In UTF-8 the Hyphen (Dash, or Minus Sign) is still #45, but the en dash and em dash are multibyte characters; Hex E2 80 93, and Hex E2 80 94, respectively. Art mentions, "Often the minus key is both hyphen and N-dash", as seen in Word. Actually Word substitutes an en dash for a hyphen when a hyphen is typed, and that is a user preference that can be set, like substituting "smart quotes" for the singlequote and doublequote characters. I'm not sure if this helps, but VW sees all three of these characters as being different and will sort them accordingly. Raymond
  10. Patrick, I think FPenPat() is what you are after. The names are confusing. PenPatN() sets the active pen pattern (line style) for the document. FPenPatN() returns the active pen pattern setting of the document. GetLSN() returns the line style of the referenced object (by handle). SetLSN() sets the line style of the referenced object (by handle). HTH, Raymond
  11. And YES, -209 refers to the Symbol Tool.
  12. Michael, Look in the Vectorworks 201x Script Function Reference. There is an online copy at http://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#settool. There is an HTML version on your computer that can be found in the application folder; Vectorworks 201x -> VWHelp -> Script Reference -> ScriptFunctionReference.html. Look in Appendix E for SetTool-CallTool Selectors. All tool selectors will have negative numbers. Raymond
  13. Jim, If Art's link doesn't work, I'll be happy to convert them for you. I've got versions back to MC+2.0 running on a trusty G5. Raymond
  14. Hi Sam, Here's a script that works to move the progress bar 10 times, but does nothing useful. I split the process into 4 segments representing different portions of the progress bar (10%, 30%, 50% and 10%) each with 10% steps, though a simple process would have one segment of 100% with ten 10% steps. If you have questions, fire back. I'm too tired to go into any more detail right now. Have fun, Raymond PROCEDURE xxx; { Linear script showing how to move the Progress Bar 10 times. } { The "WAITs" simulate a longer process taking place. } { 2 Nov 2017 - Raymond Mullin } BEGIN ProgressDlgOpen ('Progress Bar Demo', False); ProgressDlgSetMeter ('REACTANCE (%):'); ProgressDlgSetTopMsg ('CAUTION! HIGH IMPEDANCE!'); ProgressDlgSetBotMsg ('RESISTANCE IS REDUNDANT!') ; ProgressDlgYield (0); { start at 0% } wait(1); ProgressDlgStart(10, 1); { first 10% } ProgressDlgYield (1); { Increment the progress bar } wait(1); ProgressDlgStart(30, 3); { next 30% } ProgressDlgYield (1); wait(1); ProgressDlgYield (1); wait(1); ProgressDlgYield (1); wait(1); ProgressDlgStart(50, 5); { next 50% } ProgressDlgYield (1); wait(1); ProgressDlgYield (1); wait(1); ProgressDlgYield (1); wait(1); ProgressDlgYield (1); wait(1); ProgressDlgYield (1); wait(1); ProgressDlgSetTopMsg ('THE'); ProgressDlgSetBotMsg ('END') ; ProgressDlgStart(10, 1); { last 10% } ProgressDlgYield (1); wait(1); { Next two lines not needed in VW 2017 & earlier } ProgressDlgStart(0, 0); ProgressDlgYield (0); wait(3); { Wait, so you can read last screen } ProgressDlgEnd; ProgressDlgClose; END; Run(xxx);
  15. Sam, When I get home tonight I'll post an example of a script I wrote. It took me a long time to figure out how to set it up. Hopefully I can remember how I got it running. It is very unintuitive, but it does work. Raymond
  16. Dom, Actually, you can copy text from the Message window, but you have to use the COPY command in the contextual menu. Select the text in the MESSAGE window, Right Click, Copy ... Paste elsewhere (any way you like.) I assume it works on Windows as it does on the Mac, but I have no idea why CMD-C doesn't work in the Message window. I just checked back to VW 2013 and it works at least back that far. HTH, Raymond
  17. Claes, When using Add Surface, I have found that limiting the selection to 200-400 objects is optimal for throughput. There appears to be an exponential slowdown based on the selection count. Waiting for 1000+ objects to ADD is intolerable for me, so I select small groups and Add Surface repeatedly. When done, I select the whole object and Add Surface again, but this is invariably a significantly reduced object count. If the resulting reduced object has over 1000 pieces, I'll carefully select contiguous pieces and add those. Using this approach I can be done with a 30k object count in under 5 minutes where VW night easily take 30 minutes to a few hours to complete in one pass. Raymond
  18. Pat, You're doing arithmetic after midnight (my time). You win. My mind is already mush. Please define "Late posts" – Are you counting posts after midnight, or posts we both try to answer? Who's the keeper of the tally? When did it start? What's the score right now? If this is a race from now to sunrise I think I'll concede – a good night's sleep vs. a beer; I'll gladly buy the beer ;-) Did I mention my mind is mush? Simple arithmetic - when it stops being simple, it's way past my bed time. That's been my litmus test for several decades now. It's how I tell myself I need to go to bed. g'night... Raymond
  19. Pat, it figures you'd get here first. I posted an answer in an older post, a half a day late and 50¢ short. I really should read all posts before answering any. Raymond
  20. Martin, I am seeing the same behavior in VW 2017 and VW 2018 when ungrouping. If there is a record attached to a GROUP, I get a dialog asking if I want to attach the GROUP's record to the objects inside the group. Do you get this dialog when you ungroup? Did you ever click the "Always do the selected action" box? If you did and then pressed NO, that would explain why you don't get this dialog and your objects never get the GROUP's records when you ungroup. To reset this setting, go to VW Preferences under the Session tab and click the "Reset Saved Settings..." button. Pick how much you want to reset and click OK. HTH, Raymond
  21. David, As Jim stated above, the compiler in SP1 will accept the NBS character ( and maybe others ) without kicking an error. If you can wait a few days (I'm guessing here, based on Jim's "imminent" estimate) you won't have to edit anything. Raymond
  22. My answer to David (in a PM) was his PIO's have Non_Breaking_Space (NBS) characters in his code and the compiler does not like single_byte characters in the Extended ASCII range (#128-255) . The NBS character is a High Order ASCII character (#160 decimal). UTF-8 only accepts ASCII in the 0-127 range. It is a relatively simple process to replace all NBS characters \x{A0} with TABs \t or SPACEs. I was able to edit the .vsm file in TextWrangler (yes, I still have a copy), replace all NBS with TAB, then save. The file then compiled and ran. It would be very easy to 10, 50, or 100 .vsm files in succession. BUT, BE WARNED. THIS SHOULD ONLY BE DONE ON COPEIS OF YOUR ORIGINAL PLUG-IN FILES!!! MAKE BACKUPS, THEN DO YOUR SURGERY. The NBS character is not the only character that will cause compiler problems, but it is a very common character to encounter, AND it is nearly invisible. It looks exactly like the SPACE character (#32 decimal). Any character in the Extended ASCII range (#128-255) will cause problems. For more elusive problems, it may be necessary to use a HEX Editor to see exactly what characters are in your files. HTH, Raymond
  23. David, Would you please send me one of your troubled PIO's? I'll tell you what I find. It shouldn't take posting your code to a website, and copying it back to clear the cobwebs. I'll send you my email address in a PM. Thanks, Raymond
×
×
  • Create New...