CadFather
Do you use my plugin?
I think it should solve such issues.
Posts made by AlexMozg
-
RE: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)
-
RE: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)
@thomthom said:
...
So it's not really the fixed 1000 that Google said?Maybe...
500-600 for Sketchup 5, I have been tested it. -
RE: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)
The menu buffer overflows anyway if the number of objects UI::Command becomes more then 500-600!
And unfortunately, the predefined context menu commands
(such as Explode, Hide, Erace etc.)
are not amenable to correction ,
but the commands of other plugins should always work .
craigbic
In your case, you can only limit the number of plugins which you use. -
RE: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)
@thomthom said:
Alex, this debug mode: can that help Ken work out which plugin greys out the menus?
Debugging is for informational purposes and shows the number of objects (Sketchup::Menu, UI::Command) available in the current object space.
Default debug info is off.
I think my plugin will solve the Ken's problem. -
RE: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)
@thomthom said:
That's might interesting.
But has anyone experienced any other than Fredo's old plugins to cause the greyouts? After updating his tools I've not experienced this issue any more.Not only Fredo's old plugins is cause the problem.
-
[Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)
Overview:
When you use context menu or each command of menu "Edit" any way (including via hot key), this launches all procedural objects initialized by the UI.add_context_menu_handler method.
As a rule, this procedural objects initialize new objects by Sketchup::Menu.add_item method and UI::Command objects.
UI::Command objects, unfortunately, cannot be deleted by GC.
Eventually the menu buffer overflows and all new UI::Command objects, and objects created by Sketchup::Menu.add_item method, stop working correctly.
And you can see context menu is gray .
Only restarting Sketchup will fix the issue.I think the solution to this is to redefine the methods UI::Command.new and Sketchup::Menu.add_item temporarily at the time of using the Edit menu option. The redefined methods filter their arguments and prevent the initialization of new UI::Command objects, and objects creating by Sketchup::Menu.add_item method, if any have already been initialized.
My solution was to create an universal buffer for UI::Command objects (UI::COMMANDS, Hash), where each object-command has its extra methods.
The overflow of the buffer doesn't occures, because we use the same set of the universal object-commands (UI::Command) in the process of work .
By default plugin runs automatically and
requires no user intervention in his work.
When using plugin is not required to overwrite previously
created scripts that use the context menu.The plugin control exercises in menu:
"File" -> "β’ AT β’ Utilites" -> "Context Menu Optimizer".
It includes 2 parameters:
1)on/off plugin run,
2)on/off display debug info in Sketchup Ruby Console.
INSTALLATION:
The ContextMenuOptimizer plugin works
for Sketchup versions 5, 6 and 7 (Free and Pro).
To install the ContextMenuOptimizer plugin, you should unzip
the file you downloaded (ContextMenuOptimizer.zip in principle)
into the Sketchup Plugins folder.
This operation should:
β’ Copy one script file !!!ContextMenuOptimizer_loader.rb
to the Sketchup Plugins folder.
β’ Create a sub-folder ArchTools, containing the main script files.IMPORTANT: Don't rename files!
-
RE: Crazy problem with Right Click
I wrote a plugin completely fix this problem.
If you use my plugin is no need to adjust the already installed plugins that use the context menu.
Soon I'll post it for testing.
-
RE: Model.raytest and Entity visibillity
thomthom,
I confirm that in some scenes, model.raytest don't stops at hidden layer entities. So wrote the following method, which has successfully been using.module Enumerable def each_element_satisfies?(&block) self.each{ |v| return false unless yield(v) } true end#def end#def class Sketchup;;Model def real_raytest(ray, depth=nil) depth = nil if depth == 0 path = self.raytest(ray) if not path or (path[1].each_element_satisfies?{|e| e.layer.visible?} && (depth ? path[1].length == depth ; true)) return path else real_raytest [path[0], ray[1]], depth end end#def end#class
depth = InputPoint.depth in tool
-
RE: Timer < 1.0 seconds ?
@dan rathbun said:
Perhaps something like this: ( NOT TESTED )
> .....sub.kill >
It is impossible to cause the method kill!
Otherwise tnread-object will halt existence instantly, and possibly block-code is not executed.
The kill method can be called only after the block-code is completed!
If a block-code is executed and variable repeat is a false, it is not necessary to cause thread.kill because of the thread-object has been dead at this moment. -
RE: Timer < 1.0 seconds ?
Can to somebody it is useful
def at_timer(seconds, repeat=false, &block) Thread.new do Kernel.sleep seconds yield redo if repeat end end#def
-
RE: Vertex selection/transofrm plugin
See my ArchTools VertexTool Plugin:
It is the part from my complex of plugins.
(WIP)
http://www.youtube.com/watch?v=R4WVAcu_nM0 -
RE: Image type
@avariant said:
... With some components, it works just fine, other times not.
You should take into account transformation of component!
-
RE: Image type
@avariant said:
Images have definitions?! That actually may help a lot... I'll have to take a look. Is this an unpublished method to retrieve it, or just one I've overlooked?
-
[Code] Image: definition, transformation, transformation=
A new Methods to Sketchup's Image Class:
image.definition
This method returns the definition of image
image.transformation
This method returns the transformation of image
image.transformation=(New Transformation)
This method applies a transformation to the image
class Sketchup;;Image def definition defins = self.model.definitions defins.each { |d| return d if d.image? && d.instances.include?(self)}; nil end#def def transformation origin = self.origin axes = self.normal.axes tr = Geom;;Transformation.axes(ORIGIN, axes.at(0), axes.at(1), axes.at(2)) tr = tr*Geom;;Transformation.rotation(ORIGIN, Z_AXIS, self.zrotation) tr = (tr*Geom;;Transformation.scaling(ORIGIN, self.width/self.pixelwidth, self.height/self.pixelheight, 1)).to_a tr[12] = origin.x tr[13] = origin.y tr[14] = origin.z return Geom;;Transformation.new(tr) end#def def transformation=(tr) self.transform! self.transformation.inverse*tr end end#class
Use and Enjoy
-
RE: Exit/Shutdown SU 7 ??
@hpw said:
Can I shutdown/exit SU 7 with ruby?
How?def Sketchup;;exit model = Sketchup.active_model model.save "temp_model.tmp" if model.modified? Sketchup.send_action 57602 end#def
Model doezn't realy save.
-
RE: [Plugin] Extended Views v1.2 UPDATE May 23, 2013
@unknownuser said:
Hi Chris
im having a problem with this script...use my version
http://forums.sketchucation.com/viewtopic.php?f=180&t=19323
...it does not have this failing.
And my version is more complete. -
RE: [Plugin] #SelectionHideShow.rb v1.1
@tig said:
...I didn't realise it was so much slower to use typename=="".
.....For a model ot a few kilobytes to 10 megabyte of substantial difference it is not, but my models ot 40 to 75 megabyte!
My model statistics:
@unknownuser said:
Model 68.4 Mb:
Edges 485016
Faces 128906
Component Instances 6055
Groups 3078
Section Planes 4P.S.
It was even necessary to write the analogue of SketchUp Text tool, because a standard tool begins to work very long.
-
RE: Detect a Dimmension object without .typename
Π‘ompromise decision, at the proper time to use both methods:
class Sketchup;;Entity def is_a_type?(t) t.is_a?(String) ? (self.typename == t) ; self.is_a?(t) end end
Multiplying speed in ~1.5-2 times
-
[Plugin] Edit Image Material v2.1 UPDATE! (ArchTools)
This plugin is given by possibility to edit material of image.
It is possible to change coloured, opacity and aspect ratio.
And also it is possible to replace texture.Usage:
- Select Image.
- Select "AT - Edit Image Material" from Context Menu.
- Edit Material in standart window "Materials".
Notes:
For Sketchup of version 6 and higher (Free and Pro).
Version 2.1 changes:
FIX: Colors bars or color wheel are not represented at the first editing of material.
MODIFY: The structure of plugin is fully done over.
Plugin is possible it will to be included in ArchTools (my complex of plugins).
-
RE: [Plugin] #SelectionHideShow.rb v1.1
@chris fullmer said:
Alex, I have not run any tests on typename, but I use it regularly. Are you saying that it is much slower than .is_a?
ChrisEasily to check...
The more elements in the model - the better results script.@unknownuser said:
SpeedTest
is_a? - 0.36c
kind_of? - 0.39c
class - 0.422c
typename - 1.313cModel Statistics:
edges = 48981
faces = 8009
groups = 729
components = 365
construction_lines = 1
construction_points = 4
images = 3
section_planes = 4
texts = 4
others = 2