[Plugin] Multiple Component Edit Warning
-
P'haps Chris Fulmer or TomTom will see this. Tho I have no idea whether Trim ever 'buy' plugins. I s'pect not.
Its pissing down here in the shed, I can hardly hear myself think. -
@ashscott said:
..Bug fixed so that multiple edit warnings do not appear on top of each other..
There are 2 overlapping warning windows in SU 2018. Anyone to confirm?
-
-
Worked with SU 2020. Seems not to work with SU 2021. Can anyone confirm?
-
@creativegood said:
Can anyone confirm?
Yup, busted for me as well. Bummer this is a regular use one I loved.
-
I'm not sure if the author Ash is still about...
However, it's easy to fix the error - the newer Ruby version is stricter than it was years ago !Find the relevant file:
C:\Users\YOURUSERNAME\AppData\Roaming\SketchUp\SketchUp NNNN\SketchUp\Plugins\CoastalConcepts_EditFlas\EditFlag.rb\
You'll need to edit the text to include your Windows user-name and change the NNNN as the relevant SketchUp version - e.g. 2021Select that RB file and edit it using a plain-text editor - like Notepad++...
Find the lines #17 to #21 which read...unless defined?(OPT_KEY) VERSION = '2.4.0' LOAD_TAG = Module.nesting[0].name<< ';' << File.basename(__FILE__) OPT_KEY = 'Plugin_' << Module.nesting[0].name.gsub(';;','_') end
so that they read as follows.
unless defined?(OPT_KEY) VERSION = '2.4.0' LOAD_TAG = Module.nesting[0].name.dup << ';' << File.basename(__FILE__) OPT_KEY = 'Plugin_' << Module.nesting[0].name.dup.gsub(';;','_') end
Note the two additions of
.dup
code, which copy the 'frozen-string' in the module's name and use that instead, as a frozen-string cannot now be directly changed in code, without this sidestepping... -
@tig said:
I'm not sure if the author Ash is still about...
However, it's easy to fix the error - the newer Ruby version is stricter than it was years ago !You are, as ever, awesome. Thank you for this! I'll have to edit the plugin code this weekend when I get the chance.
I keep meaning to make the time to start writing scripts for SketchUp. Are there any ruby courses or books you'd recommend? I have Automatic SketchUp by Matthew Scarpino but I expect the version of ruby has changed a lot in the years since that's come out.
-
@tig said:
I'm not sure if the author Ash is still about... However, it's easy to fix the error - ...
Note the two additions of
.dup
code, which copy the 'frozen-string' in the module's name and use that instead, as a frozen-string cannot now be directly changed in code, without this sidestepping...I just noticed this as I'm not over here at SCF much these days.
It was I who wrote this extension for Ash, long before the frozen string madness.
I did not realize that
Module::nesting[i].name
, ... actuallyModule#name
returned a frozen string. Even the Ruby v2.7.2 documentation does not indicate this. (Doesn't indicate much of anything really.)But it does make sense that all the class and module identifier strings would be frozen (likely linked to symbols.) I went back to v2.2.4 in SU2017 and repeatedly called
#name
on a module object and got a different string object and id each time called. (Not very efficient.)
The same test in latest version returns the same object, with the same id, each time called.I've not been running into it as I suppose I've not been using
String
append (<<
) much because of the gotchas like this.I'm more inclined these days to use interpolation like:
LOAD_TAG = "#{Module.nesting[0].name}:#{File.basename(__FILE__)}"
... which itself creates a new string.BTW ... the second assignment to
OPT_KEY
does not need the.dup
as.gsub
makes the copy. (Verified in Ruby 2.7.7 with SketchUp 2023.) -
Hello! First I would like to apologize if there is any grammatical error. Because I'm using Google Translate to translate from Brazilian Portuguese to English.
When I install the Edit Flag v2.4.0 plugin in SketchUp in Brazilian Portuguese, the tool name does not appear.
How could I fix this bug?
-
@ashscott Is there a possibility of getting an updated version for 2024 sketchup? Thank you
-
PLUGIN UPDATE
@paulofukuta said in [Plugin] Multiple Component Edit Warning:
When I install the Edit Flag v2.4.0 plugin in SketchUp in Brazilian Portuguese, the tool name does not appear. How could I fix this bug?
There were unicode character bugs in some of the language files resulting in silent failures for the menu command labels.
I fixed all the bugs in the language files with version 2.4.2 (see below).
@elijahpekaar said in [Plugin] Multiple Component Edit Warning:
@ashscott Is there a possibility of getting an updated version for 2024 sketchup?
I am the author of Ash's extension. (He hasn't been here in almost 2 years and not posted in the forum for almost 7 years.)
Changes for SketchUp 2024 and Ruby 3:
v 2.4.2 : 2024-04-27 by Dan Rathbun
-
Updates specific to SketchUp 2024+ and Ruby 3.2:
- Changed File.exists? call to File.exist? -
Re-focus the Sketchup window, so that the Edit Flag warning dialog no longer seizes the focus from the main modeling window.
-
Fixed the scrollbars showing in the edit warning dialog.
-
Added system font identifiers for both platforms to the "font-family" style for the dialog. The text should now show in the system font.
-
Localization:
- Fixed unicode characters in files: es, fr, it, pt-BR, pt-PT
- Added language hash files: cs, ko, ja, pl, sv, uk, zh-TW, zh-CN.
- Localized the extension description and name for the Extension Manager. -
The extension is now signed.
-
-
FYI ... Julia Eneroth has released her own edition of this feature that uses the SketchUp 2023 (and later) Overlay feature. So, for those that despise popup windows, you can see the instance path as a text overlay upon the model view instead.
Eneroth Component Breadcrumbs
https://extensions.sketchup.com/extension/880e8e68-2bd1-4451-949b-44d23ce0e2c7/eneroth-component-breadcrumbs -
@Dan-Rathbun There si also another one (maybe with more pleasant UI), component_edit_notify...
Advertisement