Jump to content

Jesse Cogswell

Member
  • Posts

    629
  • Joined

  • Last visited

Posts posted by Jesse Cogswell

  1. If I had to hazard a guess, I'd say that the SketchUp imported onto a different layer than the active layer, and that your Layer Options are set to Gray / Snap Others since that is the default.  Either try to locate the design layer containing the SketchUp model, or go to View - Layer Options - Show / Snap Others.  I almost always use Show/Snap Others rather than Show/Snap/Modify Others so that I can work on one thing at a time without accidentally selecting something in the background (selecting a piece of theater architecture while trying to select a lighting a fixture for example), but also know plenty of folks that have the opinion that, if an object is visible, you should be able to select it.  Gray / Snap Others can be really great in helping to focus in on one layer at a time since it will gray out everything not on the active layer.

    • Like 1
  2. @Jayme McColgan What you are looking for is using vs.GetCustomObjectPath to get a handle to the path object's underlying path, then using vs.PointAlongPoly or vs.PointAlongPolyN as @Pat Stanford suggested to get the X,Y point and vector (if you want to match rotation of the triangles to be tangent to the path).  To space them evenly, I would use vs.CalcPolySegLen to determine the distance between the first and last point (use vs.GetVertNum to get the index of the final point), and divide that by the number of triangles you wish to insert.

    • Like 1
  3. If you open up Document Settings - Spotlight Preferences and go to the Loads and Rigging tab, you'll see that there are two check boxes at the top: Auto-position loads when created and Auto-position loads when moved.  You might have the first option checked but not the second option.  The other thing to make sure is that there isn't anything between the lighting device and the hanging position, such as a locus or guideline (unless it's part of the position geometry).  If you move a light onto something that is not a hanging position, even if a hanging position might be below that object, Vectorworks won't make the connection.

     

    image.thumb.png.d4d72e4ff672c31efc9152227991fb1e.png

  4. @Flair-Studio I am upvoting this post because I would very much to see a revamp / upgrade to worksheets in Vectorworks, but I do have a couple of workaround plug-ins that might help you.

     

    The main plug-in in that post is for splitting worksheets so that they are easier to manage on the sheets.  From your post above saying that you are managing a door schedule with 100 entries, the split plug-in might be helpful to you.  What it essentially does is create smaller worksheets that reference the data in the source worksheet.  For non-database worksheets, it creates a direct reference link, so as the master worksheet is updated, the split worksheets will follow.  This doesn't quite work with database worksheets, so my plug-in instead copies the database data as absolute data in the split worksheets.  This means that updating the master worksheet will have no affect on the split worksheets.  However, if you run the command and select a master worksheet that already has splits, there is an option to overwrite the splits, which will the track across to any worksheets on a layer, so it's pretty convenient to update splits.

     

    There is another plug-in in that post that will "stripe" worksheets, letting you choose a color for odd rows and a color for even rows.  This normally won't work on database rows, but if you use the Split tool, the resulting splits are not database rows, so the stripe tool will work on them.

     

    I wrote those plug-ins before I had gotten used to putting images (such as symbol images) into worksheets, so I don't think it will transfer the images over at the moment.  If this is something you might need, I can look into adding that functionality.

    • Like 3
    • Love 1
  5. If you are using the Lighting Device object, which I suspect you are, the origin point of the beam is determined by a 3D Locus object located in the 3D component of the symbol.  So if you scale the geometry of the symbol, you have to also move the 3D locus point upward.  This locus point also determines the rotation point of body and yolk geometry based on pan and tilt.

  6. The one thing that is likely happening to you is that you have the Clip Cube engaged and your working plane is outside of the Clip Cube.  If you go into a straight orthographic view and don't specify a new working plane or have Automatic Working Plane engaged, VW will place the working plane on X/Y 0, which is outside of the Clip Cube.

    • Like 1
  7. 4 hours ago, VIRTUALENVIRONS said:

    Something else I don't understand is why the object below is 116 MB in size.

    Vectorworks does not compress texture images at all, so I'm guessing you're using a high resolution image as the basis for your texture.  When you're setting up your texture images, you need to have an idea of what the texture is going to be used on.  If it's going to be on a graphic label that's 1'x1' that's going to be in a small rendering at 300dpi, then it can be fairly low res.  In general, I try to have my texture images be no more than 200kb each, making exceptions for textures on large objects or objects that will be taking up large amounts of page space in the final renderings.

    • Like 1
  8. I would think that you should be able to place your hoist with the code you have above, then use vs.SetRField(h,'BrxHoist','SymbolUsed',<SymbolName>) followed by a vs.ResetObject(h) to have the hoist reset with the desired symbol.  The other option is to make a red symbol with the hoist with the settings "baked in" and then use vs.Symbol place it.

    • Like 1
  9. I am still struggling with what you want the plug-in to do.  Do you want it to stay a path object, so as you manipulate it, the PIOs from the red symbols follow the path or is the path just for initially placing a group of red symbols?  If you don't need the path after object creation, you can achieve what you are looking for using a Tool plug-in instead.

     

    If you do need to keep the path, you will use GetCustomObjectInfo to get a handle to your Plug-in Object, then feed that handle into GetCustomObjectPath to load the path into a handle.  Then you'll use a FOR loop with GetVertNum and GetPolyPt3D to get to location of each vertex.

     

    Basic code for handling the path would look like this:

     

    PROCEDURE ExampleTest;
    
    VAR
    
    	objHd,recHd,wallHd,pathHd:HANDLE;
    	objName:STRING;
    	numVerts,i:INTEGER;
    	verts:DYNARRAY[] OF POINT3D;
    
    BEGIN
    	IF GetCustomObjectInfo(objName,objHd,recHd,wallHd) THEN pathHd:=GetCustomObjectPath(objHd);
    	
    	numVerts:=GetVertNum(pathHd);
    	ALLOCATE verts[1..numVerts];
    	
    	FOR i:=1 TO numVerts DO GetPolyPt3D(pathHd,i,verts[i].x,verts[i].y,verts[i].z);
    END;
    
    Run(ExampleTest);

     

    This code stores all of the vertices of the path object into an array of 3D points.  What you do with them from there is up to you.

     

  10. 8 minutes ago, KingChaos said:

    can u specify what difference i from point to rectangle and what malus (oddities) u spoke about?

    The biggest thing is that it doesn't work like the rectangle tool where you draw based on opposite corners, instead you click to once to start the rectangle, then click to set the width, then click to set the height, either by moving out from the center of the object or from the top/bottom depending on what's set in the mode bar.

     

    I personally find them clunky and dislike the extra click, so I only use them in instances where being able to use resize handles is handy or necessary.  When I do, I usually write a Tool using GetRect to get the dimensions, then script out placing the Plug-in Object itself so that the user never has to use the awkward extra click method.  But generally, most of my plug-ins that are rectangle shaped want to have very specific dimensions that are better to be typed in to the OIP rather than interactively sized, so point objects are the way to go.

     

    One other oddity is that the origin point for Rectangle PIOs is locked to one side of the X dimension (depending on which way the user goes after setting the first point), and center of the object on the Y dimension.  With a Point PIO, you can basically make the origin anywhere you want.  Based on what I've seen you building, my guess is that you would want the XY origin to be the center of the tube, which would not be possible with a Rectangle PIO.

    • Like 1
  11. EDIT: Nevermind, it looks like you already got this far and I misread your question.  @MullinRJ's advice in the next post is more likely to be what you are looking for.

     

     

    To get the parameters into the Object Info Palette, you need to build the plug-in object as a Point Object or Rectangle Object, right now it looks like you have it set to a Tool.  If I were in your shoes, I would probably make it a Point Object to get around some of the oddities in placing Rectangle Objects.  The post that I linked above and am linking again has all of the steps you need listed out.  Look for the section called CREATING A NEW PLUG-IN, it has instructions on building the parameters.

     

     

    Essentially, you need to build the background record that serves as the plug-in parameters.  You will set these parameters in a window that looks like this:

    image.png.b57cda49f3cc2a5652ec5db42e232e2c.png.ee5688d3eb28956f3cd9a9221b8ac60a.png

     

    The Name column will be the name that the script is looking for, referenced in script by that name with a capital "P" in front.  For the example above, you would have code something to the tune of boxWidth:=PBoxWidth;  The Alternative Name column will be what the parameter is named in the Object Info Palette.

    • Like 2
  12. @Mike Rock Taking a quick glance at your code and based on what you just posted above, the thing you are missing is a ResetObject function after your SetFillBack functions.  You have RedrawSelection, but the object hasn't been properly reset, so the change doesn't update.  The reason it works with SetClass, is that you are telling VW to change the class of the object (even though it's to the same class), which forces a reset.

    • Like 3
  13. The Look At Working Plane button is still there, but it's in one of the drop downs, the view one, maybe?  Not sitting at my computer at the moment.  It's just an added click like the Organization menu.

    • Like 1
  14. This post that I wrote a couple of years ago might be useful.  It's a basic crash course in creating Plug-in Objects in Vectorscript.  This will cover setting up parameters and pulling their data as well as cover the basic structure and syntax of Vectorscript.

     

    Your code is not too terribly complicated, but I do have some questions/notes:

    • I see you have a BeginXtrd function but not an EndXtrd function.  Vectorscript will need the EndXtrd to finish the extrusion.
    • Generally, my recommendation is to create the geometry first and then use functions like SetLW, SetFillBack, SetPenFore, SetFPat on the newly created geometry (passing LNewObj in as the handle) rather than change the settings and drawing the geometry later.  This allows you to not have to reset the settings after your object is created.
    • When using SetFillFore, SetFillBack, SetPenFore, and SetPenBack, you can get away with only setting the PenFore and the FillBack in most instances.  When in doubt, make sure that the Fore and Back settings match (so that your SetFillFore and SetFillBack values are the same).
    • Like with the settings, it's better to use SetClass on the created geometry rather than changing the user's class settings anytime they activate your tool.
    • With the code you have, there is no need for you to have the line with objectHandle:=LNewObj, you can just use LNewObj unless you want to retain a handle to the original rectangle after creating another object (like if you were trying to combine two objects).
    • I am confused why you are setting a drop shadow on an extrude, especially setting the drop shadow settings with SetDropShadowData and then disabling the drop shadow with EnableDropShadow(LNewObj,FALSE).

     

    • Like 1
  15. Unfortunately, I don't think that you will be able to fulfill your first request.  From my understanding, due to the modal nature of VW, the reset and redraw won't actually register until your script completes.  At least I've never been able to achieve what you are looking for.

     

    As for the second request, look into the Rpstr_SetValueInt and Rpstr_GetValueInt functions.  They will do exactly what you are looking for, and will persist from one file to another.  If you want it to reset when you run the command in a different file, you can use Rpstr_SetValueStr and Rpstr_GetValueStr to store the name of the currently open file.  If the current filename (retrieved using GetFPathName) doesn't match what's stored in the string repository, you can use Rpstr_RemoveValue on the integer value to reset it back to its default (presumably 1), or just manually reset it in the dialog since the new value will be saved when you press OK anyway.

    • Like 1
  16. On Windows, when you press Alt once it highlights the top menu bar and allows you to go into a menu by pressing letter key corresponding with a menu item (F for File, E for Edit, M for Modify, etc).  This will override workspace shortcuts.  So, if you wanted the Mirror tool to have a shortcut of Alt + M, you'd be out of luck as it would just open the Modify menu.

     

    I had a colleague reach out to me this afternoon asking if this is a recent change, swearing that he used Alt+M as the Mirror tool shortcut.  I'm reaching out to you all on the Forums with deeper institutional knowledge.  From my understanding, this is behavior that has been baked into Windows since the beginning (the earliest I used was Windows 3.1, and I absolutely used the Alt + letter keys to jump through menus), but was Vectorworks able to override this on older versions?  The oldest version I've used was 12.1, but I never tried to make a tool shortcut that would match a menu item.  The earliest version that I have installed is 2019, and Windows will stomp on Alt shortcuts that match Menu Bar items.  Does anyone know if this wasn't the case on earlier versions?

  17. @Stefan B. Those actions are hard coded into the Truss object itself and won't appear in the Workspace Editor.  The functionality would need to be recreated in a Menu Command by VW.  It is worth a Feature Request as it shouldn't be too terribly complicated since the code already exists, but I wouldn't hold my breath for it.

    • Like 1
  18. There are a couple of things getting in your way.  The biggest thing has to do with your Availability Options.  These determine when your command can be run, and the settings you have set up are fairly restrictive:

    image.thumb.png.6514daab8ba8be739a75e30acf303f31.png

     

    The setting that is tripping you up is requiring Selection has 2D.  This means that the command can only be run on Screen Plane objects, and you have Selection has 3D set to prohibit, so the command can never be run on objects on the Layer Plane.  If you set these both to Ignore, the command will work correctly.

     

    That being said, I think there is something of a bug in Vectorworks that I never noticed before.  Changing any of the Availability Options does not show any effect until Vectorworks has been restarted.  This was tripping me up for a while, as I recognized immediately that this was an issue with Availability Options, but making changes didn't seem to have any affect.  I set all to Ignore, then restarted Vectorworks on a whim.  Suddenly the command worked perfectly.  I reset Object Selected to Require and the command worked even with nothing selected.  Restarted and then got the expected results.  I think this is the only instance where changing the Plug-in Definition requires a restart aside from changing the name (and that only affects the Workspace, the command will continue working correctly until restarting Vectorworks, which will require resetting the Workspace to see the new plug-in name).

     

    I understand that the Selection has 2D / Selection has 3D nomenclature here is confusing.  If you want the script to only work on planar objects, you will need to add in a check of some kind to your code.  One such could be through the use of IsPlanarObj.

    • Like 3
  19. For those curious, the Python code in the Marionette node is very simple:

     

    #Created 12/24/2023 Jesse Cogswell
    @Marionette.NodeDefinition
    class Params(metaclass = Marionette.OrderedClass):
    #APPEARANCE
    	#Name
    	this = Marionette.Node( "Str2NumF" )
    	this.SetDescription( 'Allows a user to convert a string value to a float value' )
    	
    	#Input Ports
    	x = Marionette.PortIn( 0,'s' )
    	x.SetDescription( "a string value" )	
    	
    	#OIP Controls
    	
    	#Output Ports
    	y = Marionette.PortOut('n')
    	y.SetDescription( "result float value" )
    	
    #BEHAVIOR
    
    def RunNode(self):
    	#Libraries
    	import math
    	import vs
    
    	#inputs
    	x = self.Params.x.value
    	
    	#script
    	b,y = vs.ValidNumStr(x)
    	
    	#outputs
    	self.Params.y.value = y

     

  20. Or you can use this Marionette node that I just fabbed up.  It works exactly like the ValidNumStr function that will properly convert a string value from a record format into a dimensional float value while also using the units specifier.  I think it's a huge oversight to not have a node like this in the standard Marionette library.

    Str2NumF Marionette Node.vwx

×
×
  • Create New...