sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Model.import not working for newbie.

    Scheduled Pinned Locked Moved Developers' Forum
    13 Posts 7 Posters 224 Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jprisbe
      last edited by jprisbe

      I have a very simple script to import a 3ds file.

      <span class="syntaxdefault">model </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br />fileName </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">"C;\\temp\\B473.3ds"<br /></span><span class="syntaxdefault">show_summary </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> true<br />status </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">import</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">fileName</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> show_summary</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">messagebox</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">status</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">commit_operation</span>
      

      When the script runs I get the Import Process dialog but I get no summary dialog and there is nothing in Sketchup.
      model.import returns true.

      If I do an import from the File menu all works well.

      What am I doing wrong?

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Can you post sample 3ds model?

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • J Offline
          jprisbe
          last edited by

          3ds file uploaded.


          B473.zip

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            Worked fine for me.. The import is not automatically placed in the model, instead it is attached to the cursor where you need to place it by clicking.

            True, the summary dialog did not appear.

            2012-05-26_172617.png

            Hi

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              If you import a 3ds file from the menu there is no summary dialog either, so the argument as true/false in the scripted method is irrelevant as it's ignored and there never is one !
              Some importers use that option, 3ds does not...
              It works just as the menu version and imports using the last used Options values, like 'units'...

              Incidentally your code includes a closing model.commit_operation but there is no matching model.start_operation("Import3ds") near the start 😕

              TIG

              1 Reply Last reply Reply Quote 0
              • J Offline
                jprisbe
                last edited by

                Still doesn't work for me. There is nothing attached to my cursor.

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Works fine for me... 😕

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • timberlineT Offline
                    timberline
                    last edited by

                    Would this work in the 'free' version of SU or only the 'pro' version?

                    1 Reply Last reply Reply Quote 0
                    • GaieusG Offline
                      Gaieus
                      last edited by

                      Yes, it would (or at least should)

                      Gai...

                      1 Reply Last reply Reply Quote 0
                      • Chris FullmerC Offline
                        Chris Fullmer
                        last edited by

                        I haven't looked much into this, but it won't work on file formats that SketchUp free does not support, like dwg.

                        Lately you've been tan, suspicious for the winter.
                        All my Plugins I've written

                        1 Reply Last reply Reply Quote 0
                        • timberlineT Offline
                          timberline
                          last edited by

                          So, the free version only has the interfaces GUI blocked for say DXF import, but I could get around that programmically by providing a ruby plug-in or C++ code?

                          Is there a plug-in for adding back the import functionality that was removed?

                          1 Reply Last reply Reply Quote 0
                          • GaieusG Offline
                            Gaieus
                            last edited by

                            Try these:
                            http://forums.sketchucation.com/viewtopic.php?t=31186
                            or
                            http://sketchucation.com/forums/viewtopic.php?t=22199

                            Gai...

                            1 Reply Last reply Reply Quote 0
                            • timberlineT Offline
                              timberline
                              last edited by

                              Thanks, That plug-in will do nicely. I have imported a test file and it worked well.

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post
                              Buy SketchPlus
                              Buy SUbD
                              Buy WrapR
                              Buy eBook
                              Buy Modelur
                              Buy Vertex Tools
                              Buy SketchCuisine
                              Buy FormFonts

                              Advertisement