Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About AEChadwick

  • Rank

Personal Information

  • Occupation
    Set Designer
  • Homepage
  • Location
    Los Angeles

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. leaving this here for future searches... here’s a quick terminal one-liner (using perl) to round numbers in a file. perl -i -pe 's/[-+]?\d*(?:\.?\d|\d\.)\d*(?:[eE][-+]?\d+)?/sprintf("%.4f",$&)/ge' [file] -i makes the changes “in place,” and "%.4f" in the sprintf controls the decimal places (in this case, 4 places) be careful—this is fast, and powerful, and it will check EVERY number it finds (Add2DVertex will become Add2.0000DVertex, Pos1.x will become Pos1.0000x) a text file like this... comes out like this... then a little manual cleaning will get it down further... (there’s probably syntax that would strip leading and trailing zeros, but i wanted to post this while i was thinking of it) —AE
  2. wtf, Paolo, that's amazing! you are fantastic. the Fox mill’s website is a mess, but i have a set i downloaded ages ago (the profiles have not changed). I will PM you a link.
  3. Totally. That's similar to how i have been creating the instruction sets to build profiles—exports from my own library of polylines of the Paramount and Fox catalogs. (Aren't those numbers something??? "-0.500000000000036" and "-0.500000000000035", like, really...?) That plug-in is excellent, it's another lovely example of the idea. It doesn't allow the illustrative customization that i want, but i appreciate seeing different versions.
  4. hey Mr O! thanks for joining in. Pick-and-place is a fine solution, but procedural generation of each profile will lend itself to several ideas i have for on-the-fly customization. I’ll check back in once i have developed something. (Hope your surgery went well! keep ice on that jaw!) —AE
  5. i've seen that plugin! it's lovely work. but. it doesn’t use the Paramount and/or Fox catalogs. and. it doesn't draw to my particular style (i love writing PIO to do my specific drawing for me...) also. my mill doesn't need 3D anything, they just want to see the profiles and read the numbers. : )
  6. I appreciate any insight; there’s not much more to specify, but i'm happy to explain and i respect you taking the time. I have profiles of every piece if moulding from several common catalogs; i keep them as a symbol library to add into drawings. My Production Designers often change their minds from moment to moment, which leads to searching, copying, pasting, etc. I figure i could speed the process up with a PIO Point Object to just change between any molding with a couple clicks—turn every profile into a series of commands, and simply case-switch through them based on catalog and number. (I think a plugin that draws the object is more flexible and more fun than something that simply automatically calls up the existing symbols. it introduces some fun ability to customize the piece on the fly.) Since I already have the profiles, it's quick work to just export—with some cleaning up. (I don't trust any script as a straight export, i just use the export as a jumping off point.) For example... NameObject('P143 Section'); ClosePoly; BeginPoly; MoveTo(0",-4.687499999999996"); MoveTo(0",-2.797591863254474"); MoveTo(2.79882798298577",0.000000000000004"); MoveTo(4.67684947143633",0.000000000000001"); LineTo(4.67684947143633",-0.737820846534148"); ArcTo(0.704415179296854",-0.715267855549387",3.904543571406666"); LineTo(0.750400322129494",-4.687499999999996"); EndPoly; SetVertexVisibility(LNewObj,0,false); SetVertexVisibility(LNewObj,1,false); SetVertexVisibility(LNewObj,2,false); Becomes part of a procedure, like... ClosePoly; BeginPoly; MoveTo(FromX+0",FromY-4.687"); MoveTo(FromX+0",FromY-2.8"); MoveTo(FromX+2.8",FromY+0"); MoveTo(FromX+4.68",FromY+0"); LineTo(FromX+4.68",FromY-0.738"); ArcTo(FromX+0.70",FromY-0.72",3.90"); LineTo(FromX+0.75",FromY-4.68"); EndPoly; SetVertexVisibility(LNewObj,0,false); SetVertexVisibility(LNewObj,1,false); SetVertexVisibility(LNewObj,2,false); i've done a similar thing in a couple PIO—using the result of an export to draw a decorative feature as part of a bigger process. It works great, and honestly the clean-up process is kind of fun—finding all the patterns and recurring numbers and shapes. but... i think after 300 profiles i might get fatigued... Anyway, roll that all through your head. I appreciate all your contributions. (And I love when JBenghiat enters a discussion, i hope he throws something in here too!)
  7. Mr Stanford, I rely on you for the cold truth. I always appreciate your responses. (I kind of figured this would end with me writing a script to process the results of the export’d script.)
  8. I have been using “Export Script” to quickly create instructions for a series of simple polygons (moulding profiles). Does anyone know any way to decrease the dimensions from 15-decimal-point accuracy to maybe 2 or 3 points? Even the simplest shape results in charming-but-ludicrous numbers like... LineTo(2.79882798298577" , 0.000000000000004"); Honestly, rounded numbers would be fine—besides, i swear that Y point is really at 0... LineTo(2.8" , 0"); I usually edit the numbers manually, but my next project involves about 500 polygons and i would love to streamline the process. I have looked through vectorworks preferences and document preferences, and I have tried different Page Unit settings. I cannot determine where export script accuracy is derived. If there is no way inside Vectorworks, I will simply export everything to a text file and use a separate shell script to just round every number.
  9. oh this is lovely! i’m going to play with it right now. Thank you for posting! —Æ
  10. Hello friends I have long desired an extensible way to add automatic ID numbers to my custom PIOs, and finally took a day to cobble one together. I am submitting it here for perusal, please offer suggestions. (caveat: I know am a hack coder, please don’t be unkind.) (also, i try to name variables knowing that my future self will never remember what “wBpstXX” was ever supposed to mean.) I wanted a system that would simply start from 1 and count up, nominatively to the number of [same objects]. I wanted it to store each number so existing objects would not change their identification--but I wanted the system to fill in available numbers, like if an object got deleted the next object would re-use the available number. This example is built off a rectangle object, purely for demonstration; in addition to LineLength and BoxWidth, the script expects a parameter called __SpecialID of type Text. This is purely to store the ID (the preceding underscore makes the parameter invisible to the user). This script will draw a box and slug the number inside. (the copy-or-new routine is simply the code example from isNewCustomObject) Some nice improvements will be an optional prefix or suffix parameter, allowing things like “W11” or “18xSF" for unique reference; and maybe the ability to add trailing or leading numbers, so “4” automatically becomes “04.” But those can all follow once the basic functionality is foolproof. See what you think. —AE PROCEDURE Plugin; VAR x, y, w, h : REAL; boxLeft, boxBottom, boxRight, boxTop : REAL; pioHandle,rh,wh : HANDLE; result, IsThisCopy, WeGotOne : BOOLEAN; NumberOfPIOs : LONGINT; pioName, thisTypeOfPIO : STRING; MySpecialID, theUniqueID : STRING; theNumber : LONGINT; TheStringWeBeChecking, theStringWeNeed : STRING; PROCEDURE GoThroughEveryPIO(EachPIO : Handle); begin theStringWeNeed := GetRField(EachPIO, thisTypeOfPIO, '__SpecialID'); if theStringWeNeed = TheStringWeBeChecking then WeGotOne := FALSE; end; PROCEDURE GenerateUniqueID; Begin theNumber := 1; repeat WeGotOne := TRUE; TheStringWeBeChecking := Num2Str(0, theNumber); ForEachObject(GoThroughEveryPIO, PON=thisTypeOfPIO); if theNumber = NumberOfPIOs then WeGotOne := TRUE else theNumber := theNumber+1; until WeGotOne = TRUE; theUniqueID := TheStringWeBeChecking; IF IsNewCustomObject(pioName) THEN begin MySpecialID := theUniqueID; SetRField(pioHandle, pioName, '__SpecialID', MySpecialID); SetName(pioHandle, MySpecialID); end; IsThisCopy := MySpecialID <> GetName(pioHandle); IF IsThisCopy THEN begin MySpecialID := theUniqueID; SetRField(pioHandle, pioName, '__SpecialID', MySpecialID); SetName(pioHandle, MySpecialID); end; End; BEGIN result:= GetCustomObjectInfo(pioName,pioHandle,rh,wh); thisTypeOfPIO := (GetObjectVariableString(pioHandle,1166)); NumberOfPIOs := Count(PON=thisTypeOfPIO); MySpecialID := p__SpecialID; GenerateUniqueID; boxLeft:=0; boxBottom:=-(PBOXWIDTH/2); boxRight:=PLINELENGTH; boxTop:=(PBOXWIDTH/2); Rect(boxLeft,boxBottom,boxRight,boxTop); TextOrigin((PLINELENGTH/2),0); TextSize(12); CreateText(Concat(MySpecialID, ' of ', NumberOfPIOs)); END; RUN(Plugin);
  11. oh fer dumb. CHR(39) will insert a single quote. hope this saves some other poor bastard a search. ?
  12. Going further, here is my sloppy attempt to remove the trailing 0. I am posting this in the hopes that someone might reveal how to use the actual feet character in a string instead of my silly fado-workaround. take pity on my tortured code...
  13. Hmm. Answering my own question, just coerce it out of Num2Str in a different way: ...that's using a fado as feet because I can't figure out how to get a hatch in there; don?t judge me. Of course, that /12 assumes imperial units (which I generally use, but that seems like sloppy code). I?m open to improvement...
  14. I use a little PIO to display scale inside Viewports that includes this... this currently creates 1" = 4'0" or 1" = 23'10" What snippet of code would change that to 1" = 4' or even 1" = 24' (close enough for estimating cable runs, seriously). *would like to do this without changing the Units... of the document; hoping there is something that will round the numbers and drop the inches. Thanks! ??


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...