Jump to content
Developer Wiki and Function Reference Links ×

A script to modify all linked accessory references


Alex-L

Recommended Posts

I’m trying to help my wife with her Vectorworks. She had all textures/accessories referenced from a server. These are .jpg files of fabrics etc. to be applied to her objects in her floor plans.

 

all the links are now broken but she has all the images locally saved but it’s asking her to manually update the links to each of them. It doesn’t seem smart enough to figure out how to re-link them all again.

 

im trying to read through the python scripting reference (as I’m a competent programmer) but I can’t find a way to do this. Possibly I just don’t know the terminology and it’s very easy (I hope).

 

any pointing in the right direction would be very appreciated.

Link to comment

I'm not clear from your description if she is referencing image files or actual renderworks textures (that get mapped onto 3D objects) from another Vectorworks file.

 

Either way, no python needed to do this.  

Look in the navigation palette (Window > Palettes > Navigation).  Click on the far right tab (references).

All the references will be listed there.  The broken or out of date ones will be red.

Right click on one of them and choose Edit.  Navigate to the image or Vectorworks file.

 

If you keep all the references in the same folder (or in a subfolder as the same folder) as the file, then you can use relative location.  Especially if you don't anticipate getting access to the server easily.

 

I think - and I hope somebody else remembers how to do this - that it's possible to export all the images that are used in resources.  

 

 

Link to comment

@michaelk thanks so much for getting back to me! she is referencing image files (.jpg), of fabrics etc. which she downloaded from furniture websites like this:

 

https://www.bebitalia.com/en/sofa-aurae (see screenshot of website below)

 

She downloads the fabric and saves it on the server. All the fabrics are organized by brand (like B&B italia), and then by type of material (e.g. fabric, stone wood), then its saved there under the name that is was downloaded as from the website - so here "ELETTRA-2492253-BIG_0.jpg"

 

She has an extensive library on the server and she copied this library to her local drive on her company laptop because she now must do home office because of the corona virus.

 

The problem is she has floor plans with tens or even over 100 fabrics linked and the folder structure is quite nested as I mentioned.

 

She has floor plans like this and without the links everything is colorless and she can't really work like that for clients.

 

I did try what you said:

 

"Look in the navigation palette (Window > Palettes > Navigation).  Click on the far right tab (references).

All the references will be listed there.  The broken or out of date ones will be red.

Right click on one of them and choose Edit.  Navigate to the image or Vectorworks file."

 

But since the folder structure is quite nested Vectorworks does not seem smart enough to figure it out and we have to manually search and re-link tens of broken links.

 

My thought was can't we just tell vectorworks all paths that were:

server-address/library/<brand>/<material_type>/<image.jpg>

are now saved at:

C:/library/<brand>/<material_type>/<image.jpg>

 

i.e. just swap "server-address/library" from all paths and replace with "C:/library" (and the folder structure after this is identical)

 

And my thought was Python could loop over all references and make this change easily, unless there was a way to "change all reference paths" or similar in vectorworks (which I didn't find)

 

I hope I make enough sense now?

 

 

image.thumb.png.b5426bcded073839a98eb45e74de19f7.png

 

image.thumb.png.1d4dbc576fe4f507c8e11a829911df8d.png

Edited by Alex-L
Link to comment

I did some poking around.  I don't think file paths for referenced objects are exposed to scripting.  ( @Pat Stanford?).

 

You can, if you really have a lot of time on your hands, export a .vwx file to a script.  It's written in PASCAL.  So it's pretty human readable.  And old.  :-).

 

I made a dummy document with one referenced image and it doesn't appear in the exported script.  And after a quick look at the scripting function reference I didn't see any reference functions.  That doesn't mean they aren't there.  

 

However, I'm still not clear how the images are being applied in the vwx document.  There may be a faster way to recover.  If you select one of the objects, the Object Info Palette will tell you what kind of object it is.  Polygon, polyline, slab, floor, wall, auto hybrid, etc.  From your image it looks like the drawing is in 2D, so the images aren't being used in 3D textures mapped onto objects.  They are probably image fills that are attribute mapped to scale?  

 

If you look in the resource manager under Images do you see a lot of image resources with names that are in italics?

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...