Extension Idea

So first off, I’m not a programmer but have this idea and have been messing around with ChatGPT, I get close but doesn’t quite work maybe it’s not possible ? The extension is for importing Civil 3D files that have a coordinate system ( would also like shp files but CAD is the priority) and what I want from this script is to either check or ask for what version of QGIS you have installed so it can get the paths correct. Then see if your SketchUp model is geolocated and if it is, to get the latitude and longitude of the model axis, then ask for what file you want to import and what coordinate system said file is in, then use the proj library installed with QGIS (C:\Program Files\QGIS 3.34.5\share\proj) to convert the said file to your geolocated Sketchup model. Would like this to work both ways, when done, export file that gets converted back to orginal coordinate system. Using the proj library would take all the mathematicals needed out of the equation. Is this possible or am I way off base ? Would any developer be interested ?

I am no programmer but I understand that the first problem that anyone involving with DWG or DXF files from Civil 3D (or other Autodesk “vertical” applications) would be that the files they generate are not regular CAD files. The only things any non-Autodesk applications can get out of them are objects made with standard AutoCad commands. Civil 3D objects are stored in the file in a format not readable by other applications.

Yes I know about Civil 3D objects, just really want the linework, blocks, and contours, which doesn’t seem to be a problem.

Could be possible. If you have specific coding challenges, post them to the Ruby API subcategory. Basically, break up your idea into small subtasks and write a Ruby method to do each one. Then combine them by calling them from a command method. For example:

This is a task for a single method thus:

module Alpro
  module QGISimport
    extend self

    def get_qgis_path
      bin = ENV['PROGRAMFILES']
      bin.gsub!(/(\\\\|\\)/,'/')
      Dir.chdir(bin) do
        wild = 'QGIS*'
        paths = Dir[wild]
        return false if paths.empty? # Not installed  
      end
      if paths.size == 1
        return File.join(bin, paths.first)
      else
        paths.sort_by! { |path| Gem::Version.new(path.split.last) }
        return File.join(bin, paths.last)
      end
    end

  end
end

And so on …

1 Like

Hi, a related issue is coordinate systems, or rather projections - as far as I know there is no way of telling SU which EPSG you want to use (here in France we generally use 2154) & so, even if we can “geolocate” vie SU & check in SU what the long, lat values are, they don’t transfer correctly to ifc exports…



So communicating with others in a design team via ifc is ok, as long as you create some kind of marker-object cube and tell people that it’s bottom left corner is x long. and y lat. plus z altitude…

I say this as you might not want to spend hours on your extension idea only to be blocked at output time if you use ifc models to share with people in your ecosystem…

Same goes for The Netherlands which also uses the EPSG coordinate system with its origin 0,0 in Paris.

OMG Napoleon really did have a lasting impact :smiley:

1 Like

Yes, we loved him at Waterloo :wink:

& even better when he went on hols to Saint Helena… :slight_smile:

1 Like

I can see the English couple sitting drinking their horlicks…

1 Like