[Plugin] ConsDeleteContext

[Plugin] ConsDeleteContext

Postby TIG » Sun Oct 19, 2008 9:29 pm

Name : ConsDeleteContext
Author : TIG
Usage : Deletes or Layers Guide-Lines or Guide-Points or Both:
accessed through the Context-menu/submenu:
it either deletes/layers 'All Active' or 'All in Selection/ALL' -
mining down into any selected groups/components...
If you pick a 'Selection' option BUT without anything selected then
ALL 'model entities' are processed! [Note: a context-menu will still
appear with NO selection, if the cursor is over an axis etc...]
It's one step un-doable [or two steps if Both Lines/Points option]...

Download

1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ConsDeleteContext.rb

Postby CadFather » Mon Oct 20, 2008 4:59 pm

..just to say thanks TIG! :)
0
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin] ConsDeleteContext.rb

Postby JClements » Mon Oct 20, 2008 6:10 pm

My thanks as well.
0
John
Illustrator
Beaverton, Oregon
User avatar
JClements 
Premium Member
Premium Member
 

Re: [Plugin] ConsDeleteContext.rb v2.0 20110710

Postby TIG » Sun Jul 10, 2011 1:44 pm

0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ConsDeleteContext.rb v2.0 20110710

Postby designerbursa » Wed May 22, 2019 8:32 pm

Moving points to layer did not work. The plugin's code needs to be edited as follows! ..

old code
def self.layerAllGpoints()
model = Sketchup.active_model
entities = model.active_entities
model.start_operation("layer active Gpoints")
model.layers.add("CPOINTS")
entities.to_a.each{|entity|e.layer="CPOINTS" if e.valid? and e.class==Sketchup::ConstructionPoint}
model.commit_operation
end

new code

def self.layerAllGpoints()
model = Sketchup.active_model
entities = model.active_entities
model.start_operation("layer active Gpoints")
model.layers.add("CPOINTS")
entities.to_a.each{|e|e.layer="CPOINTS" if e.valid? and e.class==Sketchup::ConstructionPoint}
model.commit_operation
end
0
User avatar
designerbursa 
 

Re: [Plugin] ConsDeleteContext.rb v2.0 20110710

Postby TIG » Thu May 23, 2019 4:38 pm

Thanks, this code is almost 8 years old !
No one has spotted that typo before - well done...

A more 'modern' fix for the wayward line might be:
Code: Select all
entities.grep(Sketchup::ConstructionPoint).each{|e|e.layer=model.layers.add("CPOINTS")}

Avoiding the need to first make the layer at all !
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ConsDeleteContext.rb v2.0 20110710

Postby designerbursa » Fri May 24, 2019 11:34 am

I was very happy if I could help. I'm waiting for you to update the plugin :) thanks TIG :thumb:
0
User avatar
designerbursa 
 

Re: [Plugin] ConsDeleteContext

Postby TIG » Fri May 24, 2019 1:58 pm

I've corrected the RB file previously found in the first post - viewtopic.php?p=100581#p100581
I've republished its RBZ in the PluginStore as v2.1

Download

1
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: hkh123 and 15 guests

Visit our sponsors: