• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

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 23 May 2012, 13:10

    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
    • T Offline
      thomthom
      last edited by 23 May 2012, 14:19

      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 23 May 2012, 14:24

        3ds file uploaded.


        B473.zip

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 26 May 2012, 21:27

          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
          • T Online
            TIG Moderator
            last edited by 27 May 2012, 08:57

            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 4 Jun 2012, 12:03

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

              1 Reply Last reply Reply Quote 0
              • T Online
                TIG Moderator
                last edited by 4 Jun 2012, 13:38

                Works fine for me... 😕

                TIG

                1 Reply Last reply Reply Quote 0
                • T Offline
                  timberline
                  last edited by 17 Nov 2012, 22:22

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

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Gaieus
                    last edited by 17 Nov 2012, 22:26

                    Yes, it would (or at least should)

                    Gai...

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      Chris Fullmer
                      last edited by 17 Nov 2012, 22:55

                      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
                      • T Offline
                        timberline
                        last edited by 18 Nov 2012, 01:03

                        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
                        • G Offline
                          Gaieus
                          last edited by 18 Nov 2012, 01:32

                          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
                          • T Offline
                            timberline
                            last edited by 18 Nov 2012, 03:12

                            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