Looking for a simple plugin developed


#1

hello I need a simple CSV to Sketch up plugin that will import objects with their location, size, orientation, etc on a CSV file to sketch up V16.

Please see attachment for details.

Let me know who can help me, and message me how much would it cost to develop this simple plugin and how soon can it be done. Thank you!!

Cordially,

Thomas


#2

If you would care to provide a sample .csv file with a detailed description of each column, I will consider it.


#3

Sure, here it is: https://content.screencast.com/users/ScreenshotsnVideos/folders/Jing/media/e509913f-2c25-4e59-a9cc-ffe04599934f/CVS%20to%20SU.xlsx?downloadOnly=true


#4

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?


#5

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

Thanks so much!


#6

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.


#7

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.

Import Image CSV.zip (1.7 KB)


#8

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


#9

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 https://www.screencast.com/t/CjkXAmpzNb3

Same thing when I try to import more than one object

I appreciate all your help!

Cordially,

Thomas


#10

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.


#11

Thanks so much!!

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?


#12

The messagebox indicates that there is a double quote character at the start of the pathstring.

Also Ruby uses backslashes as a escape character. Try using forward slashes in your pathstring instead.


#13

Post the .csv file that fails.


#14

here it is: http://pages.news/FailCSVimport


#15

Right I see that on the pop up error, but if you see on the CSV file path there is no quote at the beginning


#16

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.

Import Image CSV.rb (3.7 KB)


#17

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

Here is the CSV with the details.
Here are the manual steps


(zoom in)

Thank you so much for all your help!!!


#18

Great! Comparing text strings is always a little painful.


#19

[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!


#20

Well there is just one problem. The image doesn’t have a size until you import it and give it one.

EDIT:

One possibility would be to incorporate the default size in the image name.

replaced rotation with layer.
Import Image CSV.rb (3.7 KB)