An Excel file is not a csv file but not a problem. However I donât find anything describing the columns and what they represent. Such as
Column A, is that the model that is to be created and/or added to?
Column B is the image file to be loaded?
Column C is the size that the image is to be scaled to? Not sure how you give an image depth.
Column D, âLocation(from center)â. From the center of what, the model or the image?
Column E, âDirection,(pointing to)â. What are we pointing? The left edge of the image?
Column F, âRotationâ. Rotation around the Z axis? Doesnât this conflict with Column E?
Column A, is that the model that is to be created and/or added to? added to
Column B is the image file to be loaded? right
Column C is the size that the image is to be scaled to? Not sure how you give an image depth. right ignore that one
Column D, âLocation(from center)â. From the center of what, the model or the image? The model
Column E, âDirection,(pointing to)â. What are we pointing? The left edge of the image? The image center
Column F, âRotationâ. Rotation around the Z axis? Doesnât this conflict with Column E? right ignore that one too
Is it wise to concatenate multiple numerical dimensions in one string (and a single column) with different syntaxes (7"X8"X2" or 13.3",4.1",10.9")?
This makes parsing more difficult, requires validation, and users will still sooner or later mistype the syntax. Spreadsheets from our customers always have errors. I would have chosen three numerical columns for size, location, direction and the only allowed unit in the column header.
As Aerillus said, the format of the data will need some adjustment in order to separate the columns and the data within the column.
After changing the , separating the columns to a ;, I was able to import and place the image. Since .add_image requires a size, I was able to use the height and width of column C to size the image.
The attached zip contains the plugin and the modified .csv file. Copy plugin to the Plugins folder and restart Sketchup. The plugin will be found in Extensions>SDM Tools>Misc Tool>Import Image CSV.
For columns in spreadsheets like this, Iâd suggest to mimic the dynamic attribute names in SketchUpâs Dynamic Components extension for the spreadsheet column headings.
Ie, transformation is relative to the current entities context and fields names are (in triplet order of: translation, then scaling, then lastly rotation,) ⌠"X", "Y", "Z", "LenX", "LenY", "LenZ", "RotX", "RotY", & "RotZ".
Thanks, it almost worked, (by the way make sure you PM so I can compensate you for all your help)
Now when I import it modifying the values, like change the its size or placement change, It fails with an error message âSketchUpTest1.skp is not foundâ even thought its right there 2018-08-27_1047
Same thing when I try to import more than one object
The plugin uses the full path of the model not just its name to find and load it. So the model is not located where the .csv file says it is or there is some difference. An added space or spelling difference. All I know is that it works for me. No need to PM, you donât owe me anything.
Well its weird because it works great using the csv you sent as an example. However when I only modify the dimensions or location without changing the file path, it gives me that error message
So both times I leave the model is located in touched, It works one time, yet the other time it says it can find the model, so it cant be a location problem other wise it will be an error all the time, right?
If you look at the .csv file using Notepad you will see that double quotes are every where because the cells are formatted as strings and are exported that way. I have made a modification to the plugin so that it eliminates all double quotes and ran it successfully using your Failimport.csv file.
it worked!! Wonderful job, thanks so much!! now just a few questions:
(as always let me know any cost)
1-Is there a limit to the number of objects imported?
2-Is there a way to add the default image ratio as an option?, because I realized sometimes they get stretched. So can we add the option say when the word âDefaultâ is placed instead of the measurements it will set the default ratio?
3-Can additional column (F) be set for the objecton a specific layer
4-How can I make it interact with the 3D editable text/url plugin that I have developed?
So it can import a 3D editable text linked to a URL
[quote=âsdmitch, post:18, topic:75374â]
2-Is there a way to add the default image ratio as an option?, because I realized sometimes they get stretched. So can we add the option say when the word âDefaultâ is placed instead of the measurements it will set the default ratio? If there is a single âdefaultâ size, why not just enter it. If there are multiple âdefaultâ sizes, how is the plugin to know which to use
[/quote] well a better way to put is to lock the original ratio so that way it wonât get streched when the height is increased or decreased.
It will be awesome if you can implement these features!, I am very excited about them!