Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
har

Dynamic Image Link

Recommended Posts

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!

Share this post


Link to post

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

Capture.JPG

Edited by Alan Woodwell

Share this post


Link to post

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 ;)

 

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

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.

×