Jump to content

Pat Stanford

Moderator
  • Content Count

    5,435
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. Pat Stanford

    learning script

    PIOs are Hybrid Objects meaning they have a 2D (screen plane) component that shows in Top/Plan and a 3D component that shows in all other views.(actually since there are now multiple 2D views that is not entirely correct, but you get the idea. If there are no Screen Plane objects, then the 3D portion will show in Top/Plan as a wireframe. If there are no 3D objects (layer plane or working plane) the 2D will show in all views. You must have some kind of 2D object in your PIO script that is making it a hybrid. Probably the same error in the code that is not doing the subtraction properly. Make sure you have Handles to the correct objects before you do the subtraction.
  2. Pat Stanford

    Object not working like an object?

    Just to expand on Michael's comments, Image Fills only work with 2D Objects (and probably a few edge cases). For putting images on 3D objects you do need to create Renderworks Textures.
  3. Pat Stanford

    learning script

    In my opinion, making a PIO is much more complicated than making a script. You could create a script that would display a dialog box, get a value, store that in a variable and then use that to modify how the script works. Once you have it all working OK you could then relatively easily convert that to PIO and delete the dialog boxes and convert those variables into parameters. There are just a lot of small details (from how you name variable/parameters to how you get into the code to edit it) that are more complicated in a PIO. If you add that level of frustration to just trying to learn to code, it will make it harder. Plus, if you make a PIO, you can't just post a file for us to try and help. If you only post the code from the PIO, then either we have to create the PIO (including all of the parameters and defaults), or you have to send the PIO and we have to add it to our workspace to be able to help. I personally am much less likely to help with a PIO problem than with a script problem that I can work on quickly. 😉
  4. Once you create a PIO you have to use the Workspace Editor to add it to either a palette or a menu. You get to decide where to place it. I don't think VW is going to be nearly as simple as this was in TopSolid. My guess is that it is going to take you probably 10-100 times longer to make the equivalent in Marionette. To start, I would manually make one of the objects using all of the pieces you need. Then you can start to think about how you are going to create a Marionette to put all of those pieces into the drawing in the correct locations (parameters) to generate the final object. Then create a marionette to do the most basic part of the object and get that working. Then add additional parts one or a few at a time and keep moving forward. Marionette is the correct tool (in my opinion) for doing this in VW, but hooking up all of the parameters for 130 parameters is going to take some time. On top of the time you are going to spend learning VW and Marionette. Use the Create Custom Object tile to insert PIOs or the Symbol tile to insert symbols. Both are under the BIM heading. Good luck. Ask again as you get stuck and we will try to help.
  5. Pat Stanford

    learning script

    The faceting is due to your OpenGL Options being set to Low. Try setting it to high and it will be much smoother. Procedure Test; Var H1,H2,H3,H4: Handle; {create handles to be able to access objects} N1: Integer; {create a variable to accept the result fo the subtract} Begin Rect(-10,-10,10,10); {draw rectangle} H1:=LNewObj; {Get handle to rectangle} H2:=HExtrude(H1,0,5); {extrude rectancle} Oval(-3,-3,3,3); {draw circle} H1:=LNewObj; {get handle to circle. Not I am reusing handle variable} H3:=HExtrude(H1,0,10); {ectrude circle} N1:=SubtractSolid(H2,H3,H4); {subtract the extruded circle from the exturded rect} AlrtDialog(Concat('The Result of the SubtractSolid is:',N1)); {optional: report return value of subtraction} End; Run(Test);
  6. Pat Stanford

    Vectorscript troubleshooting

    The ForEachObject call is not passing a handle to the record, but rather to the object with the record attached. You should use a different variable name for the handle being passed to HowManyPeople. You will then need to get a handle to the record that is attached. You will need to do something like this to find the right record: N1:=NumRecord(myHand); N2:=1; Done:=False; While ((N2<=N1) and (Done<>true)) do Begin RecHand:=GetRecord(mYHand,N2); RecName:=GetName(RecHand); If RecName='My_Field_Name' then Done:=True; End; and then use RecHand in your Str2Num function.
  7. Pat Stanford

    Force move command?

    Also check out the VW Preferences, Interactive tab. There you can set the size of the Selection Box and the Snap box (as well as the color and thickness or the boxes). By making the Selection Box (inside box) smaller and the Snap Box (outside box) larger you can make it easier to snap to points without accidentally selecting those objects.
  8. Pat Stanford

    Vectorworks Fundamentals - Dimension error

    In the top set of options in the gear dialog options, choose the top option Use Floating Data Bar and let us know if that does what you need.
  9. Pat Stanford

    Vectorworks Fundamentals - Dimension error

    Please go to the right end of the mode bar and click the gear icon and send us a screen shot of how you have those settings set.
  10. Trying to use VW the way you used AC will likely result in great frustration. There are just too many differences. You need to accept that you will need to learn to do things in the VW way. As Mike says, Snaps are basically the same as your loci. You can set them to provide end/mid/intersections or even a random division. By hovering over an object you can see little tick marks that are the current snap points. If you grab and drag the point on an object you want to move you can then "read" the snap points and put it exactly where you want. You might also want to check out the help files on the Snap Box versus the Selection Box of the smart cursor. This determines how close to a snap point you have to be to get it to snap versus how close you need to be to get it to select. You may also want to read up on the Snap Loupe to let you temporarily zoom in to make a selection or pick a point.
  11. Pat Stanford

    Counting Plug-In Object

    Joshua is correct. As always. But perhaps a little more detail will help. The =N returns the Name of the object. This is the name that you can type into the OIP. I think it also returns the "source" object for PIOs and Symbols. VW is very picky about names and only one object in a file can have a specific name. You can't have a class named Door in a file that has a Door object in it. Your script retuned 1 because there is only 1 object with that name in the file. It is the definition of the PIO. PON to return the plug-in name or S to return the symbol name are usually better options for criteria.
  12. Pat Stanford

    What are these view boundaries?

    It used to be the only way to do a perspective view before Viewports. Now the viewport boarder basically acts as the crop object of a perspective view. But it is still available if you want a limited perspective on a design layer.
  13. Pat Stanford

    Script issue

    I kind of guessed that might be the case. Keep asking and we will keep trying to help you out. But response times might be longer than what you got this morning. 😉
  14. Pat Stanford

    Script issue

    PushAttrs; TF:=GetCustomObjectInfo(ObjName,ObjH,RecH,WallH); CurrentCl:=ActiveClass; FillBack(256); FillFore(257); FillPat(1); PenPatN(2); PenSize(6); PenBack(256); PenFore(257); PenPatN(2); The above lines store the old attributes settings (Push Attrs) and set the attributes that objects drawn during the execution of the script will use. The PopAttrs at the end of the script returns the settings to what they were before the script was run. If you really want to use the class attributes, everything from FillBack to PenPatN could be deleted. IF (PBuildMat = 'wood 1 x 3')|(PBuildMat = 'wood 1 x 4')|(PBuildMat = 'wood 2 x 4') THEN BEGIN FillFore(46529,34664,22800); {0=black} FillBack(46529,34664,22800); {65535=white} END ELSE BEGIN FillFore(52428,52428,52428); {0=black} FillBack(52428,52428,52428); {65535=white} END; These lines control the color that the fill is set to. If you want to use the class attributes you could eliminate the IF/Else and just use SetFillColorByClass; IF TF=True THEN BEGIN NameClass(CMClass); SetClLSN(CMClass,2); {Line style} SetClPenFore(CMClass,0,0,0); {Pen fore color} SetClPenBack(CMClass,0,0,0); {Pen back color} SetClFPat(CMClass,2); {Fill pattern} SetClFillFore(CMClass,cRed,cGrn,cBlu); {Fill fore color} SetClFillBack(CMClass,cRed,cGrn,cBlu); {Fill back color} SetClUseGraphic(CMClass,TRUE); {Use gfx attri at creation} SetClLW(CMClass,180mm); {Line weight} END; This section sets the attributes of the class based on the RGB values you specified earlier in the script. But it does not tell the object you are drawing to use the class attributes. But the next line switches the active class so that the class you set the attributes for is not active. So this code is not really doing much for you. I don't know exactly what you are trying to accomplish, but if you want to use the class attributes, you need to change the first block to make all the attributes ByClass instead of the settings that are shown. Then when you change the class the object will use the class settings. And if you do this you can simplify the script to remove all of the RGB setting code as that will all be done in the class setup. If you want to manually set the attributes as you are doing that is fine, but you can't manually set the attributes and then also expect them to use the class settings. It is one or the other. If you are using attributes by class you probably don't want to change the class attributes in the script that is drawing the objects as everything else in the file using those class attributes will also change. You will probably need to have a wood class and an aluminum class and set the object in the correct one rather than setting the attributes manually.
  15. Pat Stanford

    Script issue

    If you can share the script someone will be glad to look at it. I will when I can, but I am leaving on a trip later today.
  16. Pat Stanford

    Script issue

    The FillBack, FillFore, etc. are setting the defaults for the document. Any new object drawn will use those attributes. It sounds like you actually want to set all of the attributes to be ByClass so that when you change the class of the object the attributes will change also. Check out the SetLSByClass (and all of the other ByClass functions) to set the attributes by class. If you use the offline function reference, you have the option to "View By Class" at the upper left. Then check out the section title Object Attributes to see all of the functions that can be used to set object attributes. The off-line function reference is in the VW application folder VWHelp:Script Reference:ScriptFunctionReference.html
  17. Pat Stanford

    Vectorworks Fundamentals - Dimension error

    I sounds like you want to make sure you have the Allow Numeric Keypad Entry for Instant Data Bar Activation option in the second set of options. I you don't have this selected, then by default the numeric keypad is used to switch between the standard views. 2/4/6/8/5 Front/Left/Right/Back/Top. 1/3/7/9 Iso views. 0 Top/Plan.
  18. Pat Stanford

    Script issue

    For an object that already exists you need to get a handle to the object and use SetClass or SetClassN.
  19. Pat Stanford

    Vectorworks Fundamentals - Dimension error

    You probably want the first set to be either Use Floating Data Bar or only when tab key is pressed. Also make sure that one of the top two options in the second set is selected.
  20. Pat Stanford

    Controlling visibility using data visualisation

    The black holes appear to be a 2018 issue. They do not show in 2020. You should be able to just Update the viewport and not have to go between render modes. Or maybe since Wireframe is not a render more you do or you won't get the update button. Maybe use Hidden Line instead of wireframe? Good luck.
  21. Pat Stanford

    Controlling visibility using data visualisation

    I have it working here in both 2020 and 2018. Visualization in 2020 has been greatly enhanced, so if you really need to do this, you should at least consider upgrading. There is a very limited set of dates, so only a few dates will show a difference. I know everything will be visible in 1955, nothing will be visible before 1900 or after 2000, and at least some items will be invisible in 1991. You are correct. If you need multiple dates we can either modify the script to give you boolean fields for those dates or give you multiple scripts that store the data into different fields that can be used on different viewports. You are correct that the Enable should be on and the Record Field should be Year. For False the pen and fill should be None. I don't know why it is not working for you. Unless you are using OpenGL where it did not seen to hide objects properly. Year 1991 Year 1955
  22. Pat Stanford

    zoe

    I am out of ideas. You should probably contact Vectorworks technical support directly. Sorry.
  23. Pat Stanford

    Title Blocks

    Glad it is working for you now. There is also a similar set of folders under Defaults that contain what shows up as Default Content for a number of tools. That would have been my next suggestion. You would probably also be better off putting your files into either a Workgroup Folder or your User Folder rather than in the Applications folder. Anything in the Applications folder could go away if VW decides they need to make a change during a service pack installation. If you decide to leave the file in Applications, make sure you have a backup somewhere else just in case. I don't know of a way to force the title block to match the paper size automatically, but after placement you can change it to an Unstyled title block and set the Title Block Scale Factor to get it to the size you need. Probably best to create different styles for different paper sizes so that it will always look the same at that paper size.
  24. Pat Stanford

    How do I save custom settings to Workgroup Library?

    If you are on a Mac it appears you can use Symbolic Links to accomplish this. A Symbolic Link(SymLink) is like an alias on steroids and basically tells the operating system to treat a single file or directory as if it exists in multiple places. During my test, I used a SymLink from the Settings:DWG_DXF folder in my Workgroup folder back to the Settings folder in my User folder. Then when I saved a DXF Export Setting file it showed up in my Workgroup folder. This is a system level function and must be done from the Terminal. Make sure you make a backup before you start playing. The command I used was: sudo ln -Ffs Path/to/workgroup/folder/Settings/DWG_DXF Path/to/User/Folder/Settings The sudo stands for Super User Do. This will require an administrator password and will allow a function that you do not normally have permission to do to occur. The command to make the SymLink is ln. The -Ffs are the options. The Fs allow an existing folder to be unlinked and deleted. The s makes a symbolic link and is required if you want to link folders. After you type in the first part of the command you can drag the folder from a finder window into the terminal window to paste in the two paths. With the source path on Dropbox or a server, and the destination in the User folder, any saved settings from any user should show up in the Workgroup folder and be accessible by anyone else in the workgroup. You may want to set up an extra workgroup folder for this kind of saved settings rather than use a single generic workgroup folder for everything. Sorry it took so long to make time to try this.
  25. Pat Stanford

    Controlling visibility using data visualisation

    OK Here is a version very lightly tested in VW2018 SP3. OpenGL rendering does not seem to work properly, but wireframe, hidden line, and Renderworks do. Dual Data Visualization v2018.vwx

 

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.

×