• Content count

  • Joined

  • Last visited

Community Reputation

36 Great


About MullinRJ

  • Rank
    1000 Club

Personal Information

  • Occupation
    Circuit Board Designer

Recent Profile Visitors

848 profile views
  1. Obviously not known by everyone. Are there any "known" workarounds? Thanks, Raymond
  2. Sorry Michael, no new ideas here. Questions, but no ideas. Does this happen in all files? Files created from a VW 2018 template? Blank VW file? Files converted from earlier VW version(s)? PageBased, or WorldBased symbols? Can you post a problem file here? Raymond
  3. Michael, What is your Snap Grid distance set to? Menu "Tools -> SmartCursor Settings...", or CMD-8. If you have constraint "Snap to Grid" enabled, and the Snap Grid is LARGE compared to your screen area, you'll be placing symbols at the origin all day long, assuming the origin is visible in your drawing window. Of course Symbols won't be the only thing jumping to the Origin, every click will land there. Please write back with the answer when you find it. I doubt I guessed it. Raymond
  4. Hello Sam, Problem 1, either draw your 2D objects directly on the Layer (GND) Plane, or move them there after they are created. Problem 2, requires manual clean up. I modified your script to address both problems. PROCEDURE EAPOnGndPlane; VAR struc, struc1, struc2 :Handle; BEGIN Rect(-40, 40, 40, -40); SetObjectVariableBoolean(LNewObj, 1160, FALSE); { Move PathRECT to Ground Plane } struc1 := ConvertToNURBS(LNewObj, FALSE); Rect(-1, 1, 1, -1); struc2 := LNewObj; SetObjectVariableBoolean(struc2, 1160, FALSE); { Move ProfileRECT to Ground Plane } struc := ExtrudeAlongPath(struc1, struc2); Move3DObj(struc, 0, 0, 10); { elevate EAP } { Clean up } DelObject(struc1); DelObject(struc2); if (struc <> nil) then SysBeep; { APPLAUSE!!! } END; Run(EAPOnGndPlane); HTH, Raymond
  5. Yes. This script will toggle the SnapToLoci preference and set the MasterSnaps preference to the opposite state as the SnapToLoci preference. { Toggle VW Preference SnapToLoci, and BEEP when it's enabled. } { Also toggle the MasterSnaps preference OFF when SnapToLoci is ON, and ON when SnapToLoci is OFF. } SetPref(5, not GetPref(5)); { Toggle SnapToLoci pref } SetPref(1257, not GetPref(5)); { Toggle MasterSnaps opposite of SnapToLoci pref } if GetPref(5) then SysBeep; { Beep when enabling SnapToLoci pref } Of course, if you normally keep the MasterSnaps preference OFF, then you only need to toggle the SnapToLoci preference. HTH, Raymond
  6. Once again, THANK YOU!!! Raymond
  7. Hi Emily, To get an "orthogonal" 3D size, you must first unrotate a 3D object before using Get3DInfo(). I modified your script to do just that. I also merged your Num2StrF() statements into the SetRField() statements to shorten the script a little. PROCEDURE InputData3D; { Get 3D_Size and attach or modify a "PanelSizes" record with the info. } { 11 Jan 2018 - Emily L. - Original script works for unrotated 3D objects only. } { 11 Jan 2018 - R.Mullin - Unrotate objects before measurement, then re-rotate them. } CONST RECD = 'PanelSizes'; VAR h :HANDLE; W, T, D :REAL; Xcen, Ycen, Zcen :REAL; xRot, yRot, zRot :REAL; isMirrored :BOOLEAN; BEGIN h := FSActLayer; REPEAT if Get3DOrientation(h, xRot, yRot, zRot, isMirrored) then begin Get3DCntr(h, Xcen, Ycen, Zcen); { get 3D center } { unrotate 3D object } Set3DRot(h, 0, 0, -zRot, Xcen, Ycen, Zcen); Set3DRot(h, 0, -yRot, 0, Xcen, Ycen, Zcen); Set3DRot(h, -xRot, 0, 0, Xcen, Ycen, Zcen); Get3DInfo(h, T, W, D); { get 3D size } { re-rotate 3D object } Set3DRot(h, xRot, 0, 0, Xcen, Ycen, Zcen); Set3DRot(h, 0, yRot, 0, Xcen, Ycen, Zcen); Set3DRot(H, 0, 0, zRot, Xcen, Ycen, Zcen); { store data in attached record. } SetRecord(h, RECD); SetRField(h, RECD, 'Width', Num2Strf(W)); SetRField(h, RECD, 'Height', Num2Strf(T)); SetRField(h, RECD, 'Depth', Num2Strf(D)); end; { if Get3DOrientation } h := NextSObj(h); UNTIL(h=NIL) END; RUN(InputData3D); HTH, Raymond
  8. Pascal, From your original script, I assume you want to use "ab" and "db" as real numbers. The values stored in the Plug-in that you reference as "Pab" and "Pdb" are STRINGs. To use them as numbers you use the Str2Num() function. You need to leave the original type declaration for "ab" and "db" as REAL. So: VAR ab, db :REAL; ... BEGIN ab := Str2Num(Pab); { converts Pab from STRING to REAL } db := Str2Num(Pdb); { converts Pdb from STRING to REAL } ... This should make your code snippet compile. HTH, Raymond
  9. tismacfan2, You have defined "ab" and "db" to be REAL numbers. If I translate "Keuzelijst" correctly it means "pick list", or "pop-up" in the English version of VW. The value of "Pab" will be of type STRING, even if the data in "Pab" represents a number. All elements in a Pop-up list are of type STRING. You will have to use Str2Num() to make the assignment. TRY: ab := Str2Num(Pab); db := Str2Num(Pdb); Your parameter "Pd" should be a number as its type is Afmeting, or Dimension. It's possible the error on line #15 will go away when the errors on the previous lines are corrected. Raymond
  10. tismacfan2, I am not sure exactly what you want, but the following script will create a rectangular Extrude object of 0-height on the Layer Plane, but you must draw it in Top/Plan or Top view. Since it is already an Extrude, you can use the OIP to set its Extrude Height, and Bottom Z-value. If you want to use this as a Tool, a different approach will be needed. (i.e., more code). PROCEDURE RectExtrude; { Draw a Rectangle, convert it to an Extrude w/ ZERO height. } { Extrude height and Bottom Z value can then be changed in the OIP. } { The initial rectangle is drawn on the Layer Plane. } { This script works as expected in Top and Top/Plan views, } { but in other 3D views the rectangle shifts position. } { 7 Jan 2018 - Raymond J Mullin } VAR H :Handle; X1, Y1, X2, Y2 :Real; BEGIN GetRect(X1, Y1, X2, Y2); Rect(X1, Y1, X2, Y2); H := HExtrude(LNewObj, 0, 0); END; Run(RectExtrude); HTH, Raymond
  11. I've always used Cut, then Paste-in-Place (Cmd-X, Cmd-Option-V). Raymond
  12. 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);
  13. 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
  14. 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