sketchucation logo sketchucation
    • Login
    1. Home
    2. rknmag
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    R
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 6
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Add_group API returns component instance?

      Hi

      This issue seems to be related to removing "Susan" definition. Please refer the following code, in this If I remove the code, which erases Susan, then the temp_group creation is success else it return ComponentInstance.
      And also, I get this error only when I put this code in a rb file and put in "Plugin" directory , if I save the rb file in some other directory and load that file from Ruby console, I don't face this issue.

      ` component_list = Sketchup.active_model.definitions
      cm = component_list["Susan"]
      if(cm != nil && cm.count_instances > 0)

      If I comment out following line, it works

      cm.instances.each { | entity | entity.erase! }
      end
      entity_list = Sketchup.active_model.entities
      temp_group = entity_list.add_group
      UI.messagebox("temp_group class: #{temp_group.class}\n")
      temp_entity_list = temp_group.entities`

      Thanks
      rknmag

      posted in SketchUp Bug Reporting
      R
      rknmag
    • RE: Add_group API returns component instance?

      Hi

      I tried in Ruby console as suggested by you and it works without any issue. For that matter, If I have only this part of the code in a .rb file and load into Sketchup that also works. My problem comes up in my main program where some more rb files are loaded. Unfortunately those files are too many and inter-related, so now I am trying to separate them and load one by one to isolate the offending code.

      posted in SketchUp Bug Reporting
      R
      rknmag
    • RE: Add_group API returns component instance?

      Yes, I tried in two different machines. I also uninstalled Sketchup, download latest version and reinstalled but no luck

      Thanks
      rknmag

      posted in SketchUp Bug Reporting
      R
      rknmag
    • RE: Add_group API returns component instance?

      Hi

      I am checking the class of the add_group() return value immediately, no other code in-between.

      Thanks
      rknmag

      posted in SketchUp Bug Reporting
      R
      rknmag
    • RE: Add_group API returns component instance?

      Hi

      Thanks for the reply.

      This code is part of bigger ruby code, I am not sure, where I am messing up. I created simple ruby file with above code and it works without any problem. I stop loading all other plugin that is not helping. Next I will isolate rest of my code to see why it is happening, in case you have any pointers to look for please let me know.

      BTW : My OS is Win 7, I hope it will not have any impact on this issue.

      Thanks
      rknmag

      posted in SketchUp Bug Reporting
      R
      rknmag
    • Add_group API returns component instance?

      Hi

      I am using Sketchup 8.0.14346. In my ruby code when I use add_group API Call, the returned object's class seems to be component instance as shown in the error message here.

      model = Sketchup.active_model ent = model.entities tgp = ent.add_group temp_entity_list = tgp.entities
      ......
      ==> undefined method `entities' for #Sketchup::ComponentInstance:0x5269634


      When I try the same code in Ruby console add_group return value class is "Group", this problem comes up only when I use this code in a script. Any help please ?

      TIA
      rknmag

      posted in SketchUp Bug Reporting sketchup
      R
      rknmag
    • 1 / 1