Jump to content

Martin Crawford

  • Posts

  • Joined

  • Last visited


3 Neutral

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. My code is super simple. When the routine completes, it always up on the Design Layer. layerName = vs.GetLName(vs.ActLayer()) vs.ForEachObject( vs.ResetObject, "PON='Create Data'" ) vs.ForEachObject( vs.ResetObject, "PON='Create Circuit'" ) vs.ForEachObject( vs.ResetObject, "PON='Create Notes'" ) vs.ForEachObject( vs.ResetObject, "PON='Create Scehdule'" ) vs.Layer(layerName) I do change layers inside of Create Data and Create Circuit and it looks like whichever of those two runs last determines what layer it is on. Create Note and Create Schedule are on Sheet Layers and neither change layers. What does not make sense is why my Vs.Layer at the end does not change back to the sheet layer. Martin
  2. Is there a way to reset some custom plug-ins, and when done return to the layer that called the refresh? I have two custom plug-in, the first is a "data circuit", the second is a "data note" with info from the data circuit. From a Sheet layer I want to use a menu command to run "Refresh Notes", that will refresh the "data circuit", then refresh the "data note" and when all done I would like to stay on the Sheet Layer. Currently when I do the refresh on the "data circuit" it changes to the Design layer and so far nothing I have done can get it back to the Sheet Layer. I suspect is has to do with the ForEachObject not working like I think it should. Any thoughts on how to move forward? Thanks Martin
  3. Currently I do something similar to what you descibe, where you select everything from design layer and it will create the viewports on the raster layer. It works, however any changes can mean deleting the raster and starting over, or worse a change can occur in the layout and not get caught in raster. The new guys make this mistake more times than I would like. Why is a good question. We create our LED displays at actual size and according to the physical layout. We also create a sheet that shows the raster and how the pixels need to be within the raster. This is often very different from the physical layout. On a recent large project the raster had no resemblance to actual layout. Our goal was to reduce the number of raster and cram as much into one raster as possible. It was a game of Tetris coming up with the optimal layout, however the team did miss one small section of the physical display that caused a last minute scramble to resolve. We could have as many as 30-40 different viewport to create the raster. The thought was if I could use a custom object that creates the Viewport, then I can place one object on sheet layer, then copy and paste and change the parameters to get what I need. And if a change occurs (add a panel, change a panel, change the size of the panel), it would automatically be reflected in the raster layout. It also allow me to enforce some rules on not what can be split in the raster and what cannot. A second benefit to have everything in the custom object is it is easier to run an error check to make sure all sections of the display are mapped in the raster. On small systems, it's not an issue, on the bigger system that span multiple floors in a high rise with multiple rack room, it can be easy to miss a display and not have it appear on any raster. From reading the website, a viewport can be in a group, as long as the group is on layer. When I try to create a VP in code, it returns nil as the handle and create the Viewport on the Sheet Layer. I'm not sure of a good way to do the error checking other than a lot of ugly code to see what panels are in what viewport and what viewport is in what raster. Doable, but a lot of code.
  4. My goal is not select visually, but use the vs.SelectObj(searchCriteria) to select everything. Image a LED panel that I have assigned a display number, processor and port id. Using the SelectObj I can select everything I need, draw a rectangle, and change the rectangle parent to the Design Layer. This this part works nicely. My hope was I could then create a ViewPort, assign the VPCrop and have a Custom Object on the sheet layer that I could change the parameters and get an updated viewport. I don't think this is possible as the viewport can only have a parent of a layer (or nested layer) and can't be inside my custom object. From VectorWorks : "Creates a viewport object. The specified parent handle may only be a layer or a group contained within a layer, nested or otherwise." It's not completely tragic as I will rework the code to run from the menu. The Custom Object would have been a cleaner solution, but the menu option will work. Thanks for all the Help on this!!
  5. I just had a thought..... If I draw the correct size box while on the Sheet Layer, then change it's parent to the Design layer, then the box shows up in the correct Design Layer & in the correct position. I'm not think this may actually work, I will report back if I get it working.
  6. I am currently doing option 2, where I select an object(s), draw a rectangle, create the viewport and move it to a Sheet Layer. This works great as a menu command. I was trying to see if there is a way to convert this to a tool command. My thought was while on the Sheet Layer, you use a tool command (Create ViewPort) that has a few parameters that control what is being displayed. Then when changing the parameters I could reselect and redraw the viewport. This would make it a bit faster to create the sheets layers and eliminate the bouncing between Design and Sheet Layers that we currently doing. The part that I think is stopping me is having the Custom Object one a sheet layer draw the rectangle that will be used as the crop object as that needs to be on the Design Layer. I'm not clear on where the crop objects lives after it is part of the viewport. Is it part of the viewport or is it an object on the Design Layer. Martin
  7. i am trying to create a viewport object that will be on Sheet layer that draws the bounding box for a viewport. The main object would have a few parameters that turn select objects and draws the box that will become the viewport. i don't mind event driven (i think) as i have a few other tools that should be event driven.
  8. Can you have a Custom Tool Object that has items on multiple layers? I would like to have a viewport object on the Sheet Layer that draws the bounding box on a Design Layer. I'm thinking this is not possible?? Thanks
  9. I have two scripts, main.py and utility.py It appears that utility.py is being cached and any change I make is not seen by main.py unless I restart vw. Is this normal, and perhaps more important, how do I work around this. Can I simply delete the files in the __pychche__ folder any time a change is made? Thanks Martin
  10. I think my core issue is the my Utility.ps was being cached and any changes I made were not being picked up. I'm not sure if this is the best way, however for some of my functions used in the Utility.py I am importing what I need inside the function. For example, to get the ConvertToFeet function to see the Fraction command, I did the following: #***************************************************** # Convert to Feet & Inches & Fractions #***************************************************** def ConvertToFeet(decimalInch): from fractions import Fraction feet = (int((decimalInch / 12))) inch1 = ((decimalInch / 12) - feet) inch2 = (inch1 * 12) inch3 = (int(inch2)) frac1 = inch2 - inch3 frac2 = int(round(frac1 * 16,0)) / 16 frac3 = Fraction(frac2).limit_denominator(16) if frac2 == 0: feetString = str(feet) + "' " + str(inch3) + '"' else: feetString = str(feet) + "' " + str(inch3) + " " + str(frac3) + '"' return(feetString) I will post a different topic on how the cache works and how to work around not having to start VW every time I make a change. Thanks
  11. Yes, that is what I have done. I have a main file called CreateData.py and a Utility.py. Utility.py does not allow reference to any vs.* commands. Martin
  12. I think I was pointing to the wrong folder, so I can not import the module, however inside the Utility.py module, I am getting an error on all the vs. commands. I tried putting a import vs at the top of the Utility.py however this does not work. What do I do to get the vs command usable in the Utility.py script. Thanks
  13. I have read many of the forum posts on importing, however I think I'm more confused that I was. I have a bunch of standalone functions that I use in multiple scripts. Nothing fancy, just basic utility functions. I have taken them all and placed them into a separate python file and I would like to import these functions into my scripts. I thought it would be as simple as making sure the path is in the script path and then doing in import. My functions are in a file called Utilities.py and I'm doing a import Utilities When the code runs, I get a No Module Name. Is there a way to include the path into what is being imported, that seems like it would be cleanest option. Thanks
  • Create New...