Jump to content

Pat Stanford

  • Content Count

  • Joined

  • Last visited

Community Reputation

593 Spectacular

About Pat Stanford

  • Rank
    Vectorworks Veteran

Personal Information

  • Homepage
  • Location
    El Segundo, CA, USA

Recent Profile Visitors

4,490 profile views
  1. In Marionette, any input node that you assign a Name to will show up in the OIP (Object Info Palette). The Create Custom Object node is used to insert another PIO into a Marionette Object. In Python/Vectorscript you have to use the Plugin Editor to define Parameters that will display in the OIP. You then use those parameters to calculate where in the relatively space of the PIO to draw your objects. In VS/Python you use the CreateCustomObject function to insert a PIO into an object created by script.
  2. 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.
  3. 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.
  4. 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. 😉
  5. 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.
  6. 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);
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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. 😉
  15. 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.


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.