sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Reload component script - anyone have one

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    21 貼文 13 Posters 3.4k 瀏覽 13 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • B 離線
      BigAl
      最後由 編輯

      Thanks Dan,
      I hadn't noticed that behaviour before. Initially being only interested in getting a couple of components into the model it wasn't an issue and I would always have the proxies in the model to check that the swap worked ok.
      Looking at this again it looks like the components are all loaded into the file in turn. When I repeat ThomThom's text as below only Comp4 gets deleted if not required to replace comp3 (being the last to be loaded). Comp2 get left behind.

      newDef = model.definitions.load("J:/Comp2.skp")
      oldDef = model.definitions['Comp1']
      oldDef.instances.each{|old_inst|old_inst.definition=newDef
      t = old_inst.transformation
      ents = old_inst.parent.entities
      ents.add_instance(newDef, t)
      old_inst.erase!
      }
      newDef = model.definitions.load("J:/Comp4.skp")
      oldDef = model.definitions['Comp3']
      oldDef.instances.each{|old_inst|old_inst.definition=newDef
      t = old_inst.transformation
      ents = old_inst.parent.entities
      ents.add_instance(newDef, t)
      old_inst.erase!
      }

      1 條回覆 最後回覆 回覆 引用 0
      • 1
      • 2
      • 2 / 2
      • 第一個貼文
        最後的貼文
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement