Jump to content

Pat Stanford

Moderator
  • Posts

    12,636
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. I THINK that similarly named files in the workgroup folder override those in the application folder and the User Folder overrides the workgroup folder. I would start looking there. Or as a quick/dirty test, just drag their user folder to the desktop and restart VW. If the problem goes away, then you know it was a User Folder problem. If the problem is still there, you can delete the newly created User Folder and drag the one from the desktop back.
  2. Since Fit To Objects works on selection, not on handles, you need a way to select only a single object. Use a loop to step through each selected object and store the handle in an Array of Handles. Deselect everything. Step through the array and select the first object and do Fit To Objects. Repeat for each object in the array. If you need to still have everything selected at the end, do an additional loop through the array to select all the objects. Ask again if you need a better description.
  3. So just use the SetRField to set the control point to be where you want the label and then use the control points to set the location of the text. But actually that might not work. I seem to remember that setting values to parameters are not stored until the end of the PIO execution. So you probably need to read the original control points into variables and then modify the variables to get the location to write the text and to also set the control point values before the end of the PIO.
  4. So maybe it is SetRField(MyObjectHandle,MyPIOName,'ControlPointO1X',Concat(ControlPoint01X+Blah)); I know i have moved he control point inside a script before. I just can't remember where or even what name to search under. Sorry.
  5. ControlPoint01X:=ControlPoint01X+Blah; ControlPoint01Y:=ControlPoint01Y-Fargh; Then insert text at the new control points. Completely untested. VW not even running right now.
  6. I thought that all references to the control points were within the internal PIO coordinate system. But I am probably wrong. If I am wrong, you should be able to use the GetCustomObjectInfo to find the insertion point of the object and then set the control point offsets from there.
  7. If you already have the Tangent, then getting the perpendicular vector should be easy. Function Perp will get you the vector perpendicular to the Tangent (You will have to decide you need the positive or negative version). Vec2Ang will give you the angle. If you know the distance you want to offset the text, the X and Y distances should be just trigonometry. And I thought you were a Maths Major. 😉
  8. Procedure Test; BEGIN MoveTo(120,120); TextRotate(45); TextVerticalAlign(3); TextJust(2); CreateText('Does This Work Michatel?? You should use Vector Math To Determine the X and Y displacement That you need to move the text block'); END; Run(Test);
  9. In the Object Info Palette with the dimension selected there is a check box for "Show Dim Value" if this is unchecked then the value will not show. I don't know of a way to set the default for this to be off, but if this is happening repeatedly it sounds like you found it. Does this happen in just one file or in all files? If just one, then it sounds like you might have some file corruption and should talk directly to VW Tech support about their checking your file. If in all files, then you probably need to reset your preferences and maybe recreate your user file. Ask again if you need more help.
  10. Yes, everything you want to do can be readily easily done in either VectorScript of PythonScript. If you remember any of your Pascal and don't mind the Begins/Ends it requires, then Vectorscript is probably your best bet. If Begins/Ends drove you crazy, then you might want to consider Pythonscript instead, but then you get to deal with it being "white space" delimited and an extra space will put something at a different indent (and therefore subroutine group) level. Here is some pseudocode. Procedure Create-Set-Class; Procedure Make_It_So(H1:Handle); {procedure to be called by ForEachObject} Var S1:String; Begin S1:=GetRField(H1,'Your-Record-Name'.'Your-Class-Name'); NameClass(S1); {Note Class names can only be 20 characters long} SetClass(H1,S1); End; Begin ForEachObject(Make_It_So,((R IN ['Your-Record-Name']))); End; Run(Create-Set-Class); The above was typed into the forum, so please excuse any typos or other errors. You may want to change the criteria in the ForEachObject to limit it to just objects that are on a specific layer or have specific field values. You will definitely need to change the record and field names to match what you are using. Good luck and let us know if you need more help.
  11. I can force this to happen if I go to Page Setup the click the Printer Setup... button. From the second Page Setup dialog box, on the Page Attributes settings I have a Scale at the bottom of the page. If I set that to 50%, then the drawing only fills the top/left 1/4 of the page. There is also a second Scale setting. From the same dialog box choose Vectorworks from the dropdown at the top choose Vectorworks. If I set that to 50%, then I get a small version of the drawing in the center of the PDF page. Let us know if this helps.
  12. Unintentional, but still funny now that I think about it. Hope you are well.
  13. You are welcome. I figured the short version answer would be enough for you. 😉
  14. Kind of, but I have run out of time to play tonight. SetObjectVariableBoolean(FSActLayer,29, False); SetObjectVariableReal(FSActLayer,44,1'); ResetObject(FSActLayer); RedrawAll; 29 turn off the Auto Position Text. 44 sets the dim text offset Reset and Redraw are just there to make sure the update shows properly and are probably not needed. But what I am seeing is that negative numbers offset to the left of the witness lines and positive numbers offset to the right of the witness lines (in a horizontal dimension). I have not figured out how to shift it and stay within the witness lines.
  15. Changes to the scale sounds like it is an option in your printer driver to fit to the page. You probably need to set the paper size to match the actual printable area of your plotter. If your plotter needs 10mm margins all the way around (an exaggeration), then rather than 594 × 841 (A1) paper you would specify a drawing size of 574 x 821. Then you should be able to get an unscaled version. As to why they have not added it directly to VW is probably because there are so many 3rd party options for printers/plotter, drivers, and operating systems that all do things somewhat differently that there is not way to come up with a solution that will satisfy most (not even close to all) people. Once you get it set once for your needs you should be set to go.
  16. Can you set a custom paper size in the Printer Setup dialog box for your plotter? Set the custom paper size to be the portrait dimensions and then use One Printer Page in the Size: drop drop menu.
  17. In Vectorscript it would be SetObjectVariableBoolean(ObjectHandle, 6709, True). It should be similar in the SDK.
  18. Page Based symbols are designed to always display at the same size on a page. So if you have a drawing label of some type, it will display the same size on a page at 1:1 scale as on a page at 1:20 scale. World based symbols adjust based on the scale of the layer they are on to always be the same "drawing world" scale. So if you have a toilet to proper scale it will display properly in both the 1:1 and 1:20 scale and look much larger in the 1:1 layer. It is likely that you clicked the Page-Based radio button when you created the symbol. You can right click on the symbol in the drawing and choose Locate Symbol in Resource Manager. Then go to the Resource Manager, and right click on the symbol definition and choose Edit Symbol Options. From there you can change the symbol from Page to World (or visa versa). You might want to try in a test file first to figure out what scale you want to be in when you make the change to get it to work right for you.
  19. You can pick a Size with the appropriate dimensions from the Page Setup dialog box. Or if you click the Printer Setup button, you can then choose the paper size and orientation from there. But that works best if you have a printer that supports the final paper size you want to output on. If you send your plots out, it is less useful.
  20. The following worksheet script will return the component index of the first component in a wall that has the Function specified by the passed integer. Put this in a database and it will give you the Load-Bearing component of each wall. Use that returned value in a =ComponentName() function to get the name. You may want to put the Index into a column that can be hidden. This script can be run in any file that it exists in. If you want to get fancy, you can slightly change the way the script is called and store it as a text file accessible from any VW file. Copy and paste everything in the code block below into a new black script file (from the Resource Browser). Make sure the script is named ComponentIndex. Use the function =RunScript('ComponentIndex',1) to get the Load-Bearing component index. If you put this in database cell C3, then set C4 to =ComponentName(C3) to get the name of the component. Ask again if you have more questions. Procedure ComponentIndex; {July 11, 2019} {© 2019 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {This is intended to be run as a worksheet script and to} {return the first component number that has the function} {indicated by the integer values below} {That retuned component number can then be used to lookup} {the ComponentName.} {Run using a WS call of =RunScript(ComponentIndex,1) to return} {the component number of the Load-Bearing component.} {Pass the values below to the WSScript to get the componet with that function 0 - Other 1 - Load-Bearing 2 - Insulation 3 - Inner Finish 4 - Outer Finish 5 - Air Gap } Var WallH:Handle; B1:Boolean; NumComponents,N2:Integer; ComponentFunction:Integer; ThisFunction:Integer; Begin WallH:=WSScript_GetObject; ComponentFunction:=WSScript_GetPrmInt(0); B1:=GetNumberOfComponents(WallH,NumComponents); For N2:= 1 to NumComponents do Begin B1:=GetComponentFunction(WallH,N2,ThisFunction); If (ThisFunction=ComponentFunction) then WSScript_SetResInt(N2); End; End; Run(ComponentIndex);
  21. I don't know if you know about editing data tags or not, so I am going to go step by step. 1. Start with a Tag Style that you like. 2. Select the Tag and convert to Unstyled. 3. Click the Edit Tag Layout... button at the bottom of the OIP (will only be active with an unsettled tag). 4. If you want an additional piece of text add it as a placeholder and leave selected. If you want to reuse the existing piece of text select it. 5. You should have it say Text in Tag Layout in the OIP. 6. Make sure the Use Dynamic Text check box is selected in the OIP and click the Define Text Field... button. 7. In the Define Tag Field dialog box, make sure the Calculated Field radio button is selected. 8. If there is already anything in the Current Tag Field Definition, delete it. 9. Set the Data Source to Object Parameters. 10. Set the Object Name to Door - #Door# 11. Set the Parameter Name to Door Fire Rating - #DoorFR# 12. Click the Add to Definition button. 13. Click the OK button 14. Click the Exit Tag Layout Edit button at the top right. 15. If it does not look the way you want, go back and edit again. 16. Once it looks like you want, choose the Style Pulldown from the OIP and choose New Plug-in Style from Unstyled Plug-in. 17. The style is now only in this file. Use the Resource Browser to put it into a Favorite or even better into the Default Content (directions elsewhere on the forum) Ask again if you need additional help.
  22. It appears that Vectors are 3D as are Point3D. I think those are interchangeable. Point only has X and Y and is what is required in this case. Check out the Vectorscript Language Guide for more information.
  23. Points and 2D Vectors are the same. 3D Points and 3D Vectors are the same. My understanding is the have been given both names so as to not confuse people who are using them for different purposes. Someone who is trying to specify a point in space would think about using points. Someone who is trying to descriptor the motion of an object through space would use a vector. They both are just a combination of real values along the X/Y/Z axis.
  24. @Julian Carr That was the first think I checked also. As @WhoCanDo says, it is in the VW2019 downloadable reference. But it appears the reference is wrong. The function does not take 4 reals for the x/y coordinate, rather it takes two Points. The following works. Procedure Test; Var H1:Handle; PT1,PT2:Point; Begin PT1.x:=0; PT1.y:=4; PT2.x:=0; PT2.y:=0; H1:=Mirror(FSActLayer,True,PT1,PT2); End; Run(Test);
×
×
  • Create New...