Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

198 Spectacular


About MullinRJ

  • Rank
    1000 Club

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    United States

Recent Profile Visitors

2,048 profile views
  1. @matteoluigi , There is a problem with your syntax of the 6 IF statements. Where you have " ))=1) " you should have " ))) =1 " Your last parenthesis should be to the left of the "=". The syntax is essentially " COUNT ( ... ) = aNumber ". Yes you can have statements lilke: if ( ) then begin end else if ( ) begin end else if ( ) begin end else begin end; Notice there is only 1 semicolon at the end, and not after each else if clause. HTH, Raymond
  2. I knew someone (@Pat Stanford) would have an elegant way to get inside. Thanks, Pat. Raymond
  3. Using: Message(GetTypeN(FSActLayer)); If I select a free standing Door I get type 86 (Plug-In object). If I select a a Door in a Wall I get type 68 (Wall object). To see the Door on a test wall I have in an open document, I needed to use: Message(GetTypeN(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(FIn3D(FSActLayer)))))))))); As you can see, the door object is deep inside the Wall object. The number of objects in front of it are not exact, and are determined by the wall's construction. You should use a loop to look for the Door, or possibly try ForEachObjectAtPoint(). There may be a more direct way to get to the Door-in-Wall that someone else can point to. I've just done a cursory quick dive at this. Again, make sure your handle is pointing to a Door object before trying to access its record. HTH, Raymond
  4. Are you sure you have a handle to the Door and not the Wall? Raymond
  5. @Paolo , I did a quick test and it looks like the function HasPlugin() only returns TRUE if you have the plug-in installed in your workspace. Loading a plug-in after you have a resource/object of the same name will cause a conflict, but I don't know how VW responds in that scenario. I can only assume it causes more confusion. Raymond
  6. @Pat Stanford , You must know, as I do, that you have to get up pretty early if you want to beat @Pat Stanford to the post. 😉 LOL, Raymond
  7. Hi @Paolo , No, Plug-in names use the same name space as custom objects that you name manually, or by script. The only name space that I know of that is managed separately are the Layer Names. You can have objects, like Symbols, with the same name as a Layer and VW will not raise a conflict. I know this is confusing, but you are now on the right track. Raymond
  8. @herbieherb , It requires accessing two preference numbers – 45 & 6728 – to determine or set the current NavGraphics State. Use GetPref() and SetPref() to read and set these parameters respectively. If you still need help writing your script, please write back. Raymond
  9. Hi @Paolo. I know from testing on several versions of VW that "Siding" is not a reserved word. Would you please post a problem file so that we may investigate further? It's possible that your Mouldings Plug-ins package is using the name "Siding" and that is preventing you from using it again. Also, have you restarted VW to see if the issue goes away? If it does vanish after a restart, does it reappear a little later? Thank you, Raymond
  10. Hi @Paolo , Your test script needs an EndFolder command to compile correctly and run. Also, Name2Index() will always return "0" for a name that does not exist. PROCEDURE test; VAR h : handle; BEGIN h := GetObject('Siding'); if (h = nil) then message('No object with this name! ''Siding'' exists'); NameObject('Siding'); BeginFolderN(16); EndFolder; END; Run(test); Another problem with your script is if the folder "Siding" exists, VW will not delete it and create it again, a new folder named "Folder" will be created, then after that VW will create "Folder-2", then "Folder-3", etc., each time your test script is rerun. I believe @Pat Stanford 's approach is the right way to go – test for the handle's existence, then test for the handle's type – but you have to do different things based on: 1) if "Siding" does not exist (create your folder) 2) "Siding" exists, and it IS a Folder Type (do nothing; or delete the existing folder and recreate it from scratch) 3) "Siding" exists, but it IS NOT a Folder Type (execute your escape plan) HTH, Raymond
  11. Hello Kars (@Kars Keizer), I'm not to sure this is related, but it is confusing. From the Script Reference Appendix I get: and 6 appears to be "Final Shaded". When I run your script I get "Hidden Line", as read from the VW View>Rendering menu. I tried different constants and 5 gave me "Final Shaded Polygon", again as read from the VW View>Rendering menu. On a whim, try different constants. It may or may not work as it may also be platform dependent. I am on a MAC and you are on a PC. It's worth a try. If you find the numbers are wrong, you may have found a bug in the documentation. Raymond
  12. Hello @WhoCanDo , The constraint settings can be accessed by preference numbers. Here's a routine I wrote a couple of years ago that will do what you're looking for. function GetSnaps :String; { Return a string with the current SNAP settings. } Var S :String; Begin S := ''; if GetPref(37) then S := 'A'; { Snap to Grid } if GetPref(1312) then S := concat(S, 'S'); { Snap to Angle } if GetPref(1314) then S := concat(S, 'D'); { Smart Points } if GetPref(1316) then S := concat(S, 'F'); { Smart Edge } if GetPref(38) then S := concat(S, 'Q'); { Snap to Object } if GetPref(1313) then S := concat(S, 'W'); { Snap to Intersection } if GetPref(1315) then S := concat(S, 'E'); { Snap to Distance } if GetPref(1317) then S := concat(S, 'R'); { Snap to Tangent } GetSnaps := S; End; { GetSnaps } Enjoy, Raymond
  13. Hi Lyle, There is now. This script gives you an option to draw the circles on the Ground Plane, or elevate them to the height of the 3D Locus by changing the value of constant "Circles3D". See comments in script. I also added a dialog to let you specify the circle's diameter before the script runs. Procedure Loci3DToCircle; { Replaces every Loci in a drawing with a Circle } { centered at the insertion point of the loci. Use with care after backing up } { the original drawing. Use at your own risk. Here there } { be dragons. No warranty expressed or implied. ;-) } { Adjust the Const Radius = 1' to a unit an size appropriate to the requirement } { All Circles created will use the default class, color, etc of the document. } { January 28, 2015} { July 15, 2011} { © 2011-2015, Coviana, Inc - Pat Stanford pat@coviana.com} { Licensed under the GNU Lesser General Public License} { 08 Aug 2020 - Raymond J Mullin } { This is a modification of Pat Stanford's script to convert 2D Loci to circles. } { This script will convert 3D Loci to Circles on the Ground Plane if constant Circles3D is FALSE, } { or it will elevate the circles to the Z height of the 3D Loci if constant Circles3D is TRUE. } { This script will also use a dialog for the user to set the Circle's Diameter. } Const Radius = 6"; Circles3D = TRUE; { Circles on Ground Plane if FALSE. Floating circles if TRUE. } Var Diam :Real; Procedure DoAction(H :Handle); Var X, Y, Z : Real; Begin GetLocus3D(H, X, Y, Z); ArcByCenter(X, Y, Diam/2, 0, 360); SetObjectVariableBoolean(LNewObj, 1160, FALSE); { circle on Gnd Plane } if Circles3D then Move3DObj(LNewObj, 0, 0, Z); { elevate circle } DelObject(H); { delete 3D Locus } End; { DoAction } BEGIN Diam := RealDialog('What Diameter?', Num2StrF(Radius*2)); if not DidCancel then ForEachObject(DoAction, T=LOCUS3D); END; Run(Loci3DToCircle); Have fun, Raymond
  14. Perhaps it is because the DrawingLabels update after your script finishes, in which case you have already reset the Automatic Drawing Coordination back before any DrawingLabel code runs. If this is the case, I don't know of a way to get around it in one script. Raymond
  15. 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


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