har Posted September 14, 2016 Share Posted September 14, 2016 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! Quote Link to comment
AlanW Posted September 14, 2016 Share Posted September 14, 2016 (edited) Hi, Try this one, its a simple one. You will obviously have to create your own client logos etc but the principal is the same. Will look at a few other ways to do this like a dropdown menu. HTH Title block_001.vwx Edited September 14, 2016 by Alan Woodwell Quote Link to comment
har Posted September 14, 2016 Author Share Posted September 14, 2016 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 Quote Link to comment
AlanW Posted September 14, 2016 Share Posted September 14, 2016 Hi, there is this one by Domc for title blocks, maybe this may assist. marionette_grab_metadata.vwx Quote Link to comment
har Posted September 15, 2016 Author Share Posted September 15, 2016 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 Quote Link to comment
DomC Posted September 15, 2016 Share Posted September 15, 2016 Hi Hannes A referenced Image, with a relative path, nearly could do that. But with a new image, the scale would be wrong. So you're right, searching an automatism with marionette. Maybe the attached Node/Example can help yo to realize that. I do not know exactly, how you want to Link your Drawing to the logo. So maybe this needs to modified. The Attached Node supports the following options: 1. Path Name Absolute 2. Path Name automatically to the drawing path and automatically takes jpg with the same name like the drawing. The Node scales the image to a fixed x-value and scale from the middle. Maybe there needs to be modification to get exactly what you want to have. Dom importImage.vwx importImage.mp4 Quote Link to comment
DomC Posted September 15, 2016 Share Posted September 15, 2016 link to movie example Quote Link to comment
har Posted September 16, 2016 Author Share Posted September 16, 2016 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.