Jump to content

har

ConnectCAD
  • Posts

    32
  • Joined

  • Last visited

Reputation

1 Neutral

Personal Information

  • Location
    Austria

Recent Profile Visitors

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

  1. Hi Marissa, thanks, that does clean things up quite a bit. AND it reminds me of another topic I had actually already crossed off as impossible: Say I generate a list using the GetFilesInFolder function - to find all jpg image files in a specific directory - and then pass that on to a popup that should also work. Or wont it? I'm going to try anyway but sadly I'm busy with other work the next few days....
  2. Hi, I haven't done this myself, but afaik a Texture - much like a Line Type or Hatch - will be referenced by an Index number rather than its name - Just to make things more complicated http://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#tex Finding out the index value of your - I guess custom - texture will probably be a bit difficult. Dig through the VS function reference and you might find a way to get the texture from a referenced object/class. Personally, I've resorted to creating a Class for every "look" I want and just assign my objects to them accordingly.
  3. And while I'm at it, someone could help me clean up my code: .... type = Marionette.OIPControl( 'Panel Type', Marionette.WidgetType.Popup, 0, ['Blank','Vented','Security','Clamp'] ) .... type = self.Params.type.value #This only returns an Index value of the selected Popup Option Is there any way to directly access the selected value, rather than only its index? For the nodes I'm doing, it doesn't make a huge difference. But it is kind of unnerving...
  4. Stop it, I'm blushing I'm not using neither definitions nor dictionaries for this - way to high level. Python is actually a very easy-to-learn language - provided you understand some basic concepts of programming. It's probably a nice example to start from, so I've taken a few minutes to comment out my code - Something you should always do anyway! @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( 'Rack Panel Symbol' ) this.SetDescription( 'Creates a Rack Panel Symbol' ) #These create a Popup in the Node's OIP - Refer to: http://developer.vectorworks.net/index.php/Marionette_Implement_a_Node#Object_Info_Palette_-_Shape_Pane type = Marionette.OIPControl( 'Panel Type', Marionette.WidgetType.Popup, 0, ['Blank','Vented','Security','Clamp'] ) ru = Marionette.OIPControl( 'RU Height', Marionette.WidgetType.Popup, 0, ['1','2','3','4'] ) def RunNode(self): #All vs.XXX functions are "normal" Vectorscript functions. #Refer to: http://developer.vectorworks.net/index.php/VS:Function_Reference # #GLOBAL VARIABLES AND INPUTS # typelst = ['Blank','Vented','Security','Clamp'] #Copy list of Popup options 1 rulst = ['1','2','3','4'] #Copy list of Popup options 2 oneRU = 44.45 #global measurement for one "Rack Unit" height in millimeters rackwidth = 482.6 #global measurement for width of a 19" rack device in mm heightoffset = 4 #offset of drawn rectangles in Y widthoffset = 14 #offset of drawn rectangles in X type = self.Params.type.value #This only returns an Index value of the selected Popup Option ru = self.Params.ru.value #This only returns an Index value of the selected Popup Option name = 'Blank_'+rulst[ru] #Create string to find symbol # (rulst[ru] is the "selectionth" (ru) index of the selection copy (rulst) -> Therefor, the value selected # #CREATION OF SYMBOL 'Blank_#' # vs.Symbol(name,0,0,0) #symbol instance based on "name" above - Refer to: http://developer.vectorworks.net/index.php/VS:Symbol # #ATTACHING RECORD TO SYMBOL (to later find out how many of which type) # handle = vs.LNewObj() #handle to symbol for next step vs.SetRecord(handle, 'RackPanelRecord' ) #attach record to object vs.SetRField(handle, 'RackPanelRecord', 'RUheight', rulst[ru]) #write to record field vs.SetRField(handle, 'RackPanelRecord', 'Type', typelst[type]) #write to record field # #MAKING DIFFERENT "TYPES" # #if Popup Option "Type" is "Vented" if typelst[type] == 'Vented': vs.Rect(widthoffset,heightoffset, rackwidth-widthoffset,float(rulst[ru])*oneRU-heightoffset) #Make a rectangle handle = vs.LNewObj() #Handle to rectangle for next step vs.SetClass(handle,'KW_racklayout-Panel-Vent') #assign rectangle to class #if Popup Option "Type" is "Security" elif typelst[type] == 'Security': vs.Rect(widthoffset,heightoffset, rackwidth-widthoffset,float(rulst[ru])*oneRU-heightoffset) #Make a rectangle handle = vs.LNewObj() #Handle to rectangle for next step vs.SetClass(handle,'KW_racklayout-Panel-Secu') #assign rectangle to class #if Popup Option "Type" is "Clamp" elif typelst[type] == 'Clamp': vs.Symbol(('ClampPnl_'+rulst[ru]),0,0,0) #Make a ClampPnl symbol #There's only two version of Clamp Panels in the file (for 1 & 2 RU) as those are the only valid options. Error handling is ignored... vs.Group() #Group it all together #Not entirely neccessary (creates group in group) but I've made a habit of it as it makes some of my workflows easier. @MarissaF Thanks, please keep me updated. The proposed workflow is what I'm doing now. Problem is, I'm preparing this for all my colleagues and the poor bastards are just now switching to Vectorworks - They have enough other stuff to worry about
  5. Hi all, I've just noticed a problem with one of my Marionette Object Nodes. It instances a symbol from the ressource browser and draws some rectangles based on user defined parameters. I've saved it as a Smart Symbol to my ressources. When double clicking it in the ressource browser to insert it, the first one works okay. Every further instance I create however, will be only the default symbol instance, no further Marionette functionality. Drag and Drop from the ressource browser works fine. I hope this makes sense, please refer to the file attached. What is causing this behaviour? Is there any way for me to fix this? Thanks in advance for any assistance! 16-09-23_BlankPanelLibrary.vwx
  6. The Marionette Monday Webinars are also quite good to get you started: https://forum.vectorworks.net/index.php?/topic/43231-marionette-monday-webinar-questions/
  7. har

    Dynamic Image Link

    Hi Dom, thanks for you support. I maybe wasn't clear on my last post: My script is already done! It looks quite similar to your approach Anyway, as said I'm only linking to one specific file path in the document's directory.
  8. Hi Lee, I am an AV guy, this is the reason I'm using connectCAD. I know your task might sound very lightweight but it is in fact not all that easy. Creating an object with a defined number of connection points - That's the easy part. Then having a tool that will let you connect them to eachother - an SDK programming job. Having the lines follow you devices as you move them around on the drawing - an SDK programming job. The additional stuff that you might need - depending on your type of installations: - Rack Layouts - Metadata display - Output Device LIsts and Cable Lists - Cable Numbers - etc etc It's all doable - as the connectCAD team proves - but I wouldn't really recommend it as a first project! If you need this to work, I would still recommend investing in connectCAD. Apparently you already have VW, so the investment is even smaller than a more "lightweight" solution like Stardraw. I know, this sound like advertising, but I'm just really happy with the software. On the "does nothing node" approach: It will introduce complications for more complex schematics (no signal types, messy crossing lines, no links to different pages).
  9. har

    Dynamic Image Link

    Hi Alan, thanks for the support. I've gone down a little different route with this now: Instead of searching through a folder, there just needs to be a "ClientLogo.jpg" in the same directory as the document. Still better than what we used to do. Best Hannes
  10. har

    Dynamic Image Link

    Hi Alan, thanks for the quick example. Unfortunately, it's not a ideal option as I'm still having to edit my template anytime we have a new client. In the meantime I've found out how to create symbols from images in a folder by studying this example: http://developer.vectorworks.net/index.php/Python_Sample_Import_Images_as_Symbols So far, so good. Now I only need to have a method for selecting the correct symbol. Having the loop additionally create a list of all options is one line added to the code. However, populating a Pop-Up GPIO object with this list won't work as far as my research goes... I hope someone disagrees with me here
  11. Hi all, I'm revisiting our Title Block at the moment. While I'm at it, I'd like to add a feature that we (similarly) used to have in AutoCAD: The Title Block comes with a field for the client logo - That naturally keeps changing. Right now, we're just dragging in JPEGs and manually scaling them - I'm not a big fan of that. The first option that comes to mind is the one I'm using for language options: Have every option in a different class and turn on/off the visibility accordingly. However, that just bloats up the template file and we have to adapt the template everytime we have a new client. I'd like to have a little Marionette Node that does the following for me: - Look Up a specific network folder - List all contained image files as options to chose from - Create a linked image based on the selection - Find the maximum in width/height and scale to fit the "frame" Is that doable? Any hints to VS functions I should check out for this? Thanks to all in advance!
  12. Didn't see Alan's comment before - That should get me started then. Thanks!
  13. Hi Marissa, thanks a lot, that cleared it up. By using the 'sum' on both columns, I got exactly what I wanted - Counting all Panel objects that are the same. I've been trying to find some tutorials on worksheet scripting for a while now but didn't find anything useful. Any hints for places to start?
  14. Hi all, I can't find a proper subforum for my question, so I'm posting it here. As seen in the screenshot I'm doing the following: - Marionette Object will change its size and look according to user input via OIP (see 9 objects on shape pane) - The objects are "Rack Panel" used for 19" Rack assembly and have two parameters: "Rack Unit Height" (integer 1-4) & "Panel Type" (blank, vented, etc.) - The parameters are written into a database ("RackPanelRecord" (see exported .txt bottom right) However, when trying to generate a spreadsheet for that data, my approach doesn't seem to work (see bottom left). As seen on the drawing, there's three different versions of Panels with 1RU: "Blank", "Security" and "Vented" Instead of giving me three individual lines for each version, the spreadsheet will just "sum up" all 1 RU Panels and show "---" for the type field. What am I doing wrong? P.S.: I hope someone can make sense of what I wrote
  15. OF COURSE - I should've just given my Script a name to make the Popup accessible from "outside". Sorry, it's been a few weeks....
×
×
  • Create New...