Jump to content
Developer Wiki and Function Reference Links ×

Dynamic Image Link


har

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!

Link to comment

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

 

Link to comment

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

Link to comment

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...