Developing Importer for .SHP (or SHX) to SketchUp

Try increasing the scale to some ridiculous number like 100000 and see if it does anything different. Make sure you use the “Zoom Extents” to step back and view the results.

If you can provide an example of the errors you are getting in the console, that would be helpful as well.

Thanks, that definitely helped. Most of the items are being imported now. The only thing I have to figure out now is how to get the height properly scaled when I want a height parameter.

Here is the Ruby console I’m getting when I run the importer:

Processing: 313 records
An error occurred in 19
An error occurred in 38
An error occurred in 105
An error occurred in 115
An error occurred in 156
An error occurred in 166
An error occurred in 206
An error occurred in 257
An error occurred in 261
An error occurred in 277
An error occurred in 299
An error occurred in 304
Skipped: 12
Created: 301

Hi Jim,

I would like to download this extension, but when I try to open the file it says that there is no app associated with the file. Am I doing something wrong?

See the User Guide section …

2 Likes

A post was split to a new topic: New Modelur 2020 Tech Preview w/ GIS Importer

Jim, Is there a description of the dialog box options and what they do on your import shapefile extension?

Just a little confused on what the inputs do and how to manipulate to my advantage.

Shapefiles are comprised of three files: a *.shp file that contains the shape data; a *.shx index file linking the shapes; and a *.dbf file that contains additional data.

The values that are used are completely arbitrary in the sense that they may be GPS coordinates, meters from a reference point, or even furlongs, if that’s the choice of whomever made the shapefiles.

When using the plugin, select one of these files and you’ll be presented with something similar to the screenshot below:

image

  • The first line is a computed name for the import using the date-time stamp.
  • The second tells how many polyitems (shapes) are in the files.
  • The X/Y max/min data provides the bounding box of the data selected. Anything outside what you provide will be ignored on the input.
  • Numbers are assumed to be in inches; the scale value can be used to scale the values on input (or the model can be scaled after input)
  • The height is a default value that will be used if none are selected from the database.
  • If the database is used, it is denoted in this field.
  • If it is desired to display the bounding box on import, select this value as “YES.”
  • If you know that the shapefile data is in GPS coordinates, select the geolocate option to try and locate the model on import.

If using the database values, you will get a subsequent popup:

image

If this example, there are no height values to be useful. However, if there were, selecting the field for the height of the building, as well as the height of the base (if available), will use the various values from the database. The names of each building created will be tagged with the name field from the database (if one exists).

If no height values are available, you can select Display 2D instead.

I hope this helps … let me know what I need to clarify for you and I will try to do so.

Jim, great extension will definitely use it often!

2 suggestions, feel no obligations to add unless you want to.

  1. make the output a component with the groups nested in it. Maybe the component name is tied to the Name: in the dialog box. This would allow easier manipulation as a set. Granted, you can do it manually right after, but automatic would be nice.

  2. Make the “Number of PolyItems:” a specifiable range rather than the first XXX items. That way i could add the items in say 10000 item blocks (1-10000, 10001-20000, etc.) I was struggling to manually calculate where the area I was interested in resided in the shape file (this was not set to GPS or Lat/Long). It would have been easier to import by item number blocks and selectively deleting extraneous data.

1 Like

Just wanted to say thank you! This just saved me at least an hours worth of work tracing topo contours.

1 Like