[Plugin] Component Edit Window v1.3 12072011

[Plugin] Component Edit Window v1.3 12072011

Postby honoluludesktop » Sun Dec 26, 2010 6:24 pm

Fixed "open component file" bug.
TIG: Edit.
component_edit_window_v1.3.rb

The tool opens a selected component in a temporary [new] window for easy editing; avoiding problems with clipping planes etc.
Select a component then right-click and use the context-menu item Component Edit Window.
The selected component will now open in a new temporary edit window.
Edit the component's geometry etc, and then Save to Close the temporary edit window and to return to the original model: a dialog then asks if you want to Update that component, OK to update all instances of it, Cancel to skip.
Closing the temporary edit window without Saving returns to the original model without any changes.
All temporary edit files [stored in the User's Temp folder] are removed as the temporary edit window closes.
A selected group also can be converted to a component... and then edited in a new window by using the alternative context-menu item.
The original model's window remains is under the second temporary edit one.
If you need to refer to the original while editing, move the second instance to the side as illustrated below, or toggle between wndows...
0
Last edited by honoluludesktop on Sat Jan 08, 2011 5:14 pm, edited 17 times in total.
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Edit Selected Component Window v0.01 alpha 1226

Postby Didier Bur » Sun Dec 26, 2010 10:27 pm

Hi,

Code: Select all
system "C:\\Program Files\\Google\\Google SketchUp 8\\SketchUp.exe "+name+".skp"

I think this won't work on a Mac, and possibly won't work on a PC if SU is installed elsewhere than this default location.
I suggest you use the registry key to find where SU is installed on the user PC, or the 'Sketchup.find_support_file' method.
Best regards and happy new year,
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [Plugin] Edit Selected Component Window v0.01 alpha 1226

Postby honoluludesktop » Sun Dec 26, 2010 11:11 pm

Yes, thanks. Its currently written as:

name=cnt_instance.definition.name
dir_name=File.dirname(model.path)
comp_name=dir_name+"\\"+name+".skp"
UI.openURL(comp_name)


If I stay with system:

file_path_name = Sketchup.find_support_file("plugins")
file_path_name=File.dirname(file_path_name)+"/SketchUp "
system file_path_name+name+".skp"
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Edit Selected Component Window v0.02 alpha 1226

Postby honoluludesktop » Mon Dec 27, 2010 4:29 pm

Pc only version posted above.
0
Last edited by honoluludesktop on Fri Dec 31, 2010 3:13 pm, edited 3 times in total.
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Component Edit Window v0.02 alpha 12262010

Postby honoluludesktop » Wed Dec 29, 2010 12:13 am

Unless some compelling reason is deduced, in order to avoid confusion, and make the plugin easier to support, I will remove one of the version posted.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Component Edit Window v0.05 beta 12262010

Postby honoluludesktop » Fri Dec 31, 2010 3:11 pm

This update will change all instances of the selected component.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby honoluludesktop » Sat Jan 08, 2011 5:13 pm

0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby derei » Thu Mar 03, 2011 5:18 pm

I noticed different toolbars in Component Editing Window. Is that a feature included in plugin? will have just custom selected toolbars in new opened window?
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby honoluludesktop » Fri Mar 04, 2011 12:41 am

The component window will inherit the menus from the parent. I changed the menus in my presentation of the edit window to illustrate how the plugin functioned, in a small picture.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby Edson » Tue Mar 08, 2011 1:08 pm

for your information, the makers of Podium have released a commercial plugin called EditinPlace that does exactly what yours does.
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby EarthMover » Tue Mar 08, 2011 6:30 pm

Great idea! I always keep a 2nd SU open for this reason. This should streamline it quite a bit. Thanks! :thumb:
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby Ghalko » Sat Mar 12, 2011 11:14 pm

Definitely dabbling in the code to use existing components, or make them if they don't exist. First foray into ruby, I already dislike that it doesn't do much with curly braces and semicolons. I usually program C and PERL. :mrgreen:

I just thought that it could be setup to save in a tree of folders, might make the code quite a bit longer, but might make saving components easy and finding them individually. Now to figure out how to only save the geometry in the components file and still load it into the trunk of the tree. :shock: My ideas are getting far beyond my grasp of ruby and the API. I should keep it simple for a bit.

When I get somewhere with it would you like me to post it or send you the code for perusal/editing?
0
Arrrggghhh! Why won't it make a face!!! Stupid, no good piece of... Oh look! The line went to the wrong point. Whew... moving on. (My fights with sketchup.)

Ghalko 
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby honoluludesktop » Sun Mar 13, 2011 11:37 am

Post it in the Developers section, there you can get help from those who are truly gifted in SketchUp ruby, and the Api. Everything I have written, was with their help.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby artofseeing » Wed Jul 06, 2011 11:27 am

hi,

the plugin is missing in my index menu.

also, when i try to load the plugin via ruby console,

my ruby console puts the following:

Code: Select all
load component_edit_window_v1.0.rb
Error: #<SyntaxError: (eval):48: compile error
(eval):48: no .<digit> floating literal anymore; put 0 before dot
load component_edit_window_v1.0.rb
                              ^
(eval):48: syntax error, unexpected tINTEGER
load component_edit_window_v1.0.rb
                               ^>
(eval):48


i have su8 installed in the default location.
and i put the plugin into Plugins.

thanks for any help.
:thumb:
0
as long as there is a voyage away, there's always a journey back...


http://artofseeing.carbonmade.com

artofseeing 
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby TIG » Wed Jul 06, 2011 11:30 am

You need to pass a string to 'load' :geek:
It's NOT load component_edit_window_v1.0.rb
BUT load 'component_edit_window_v1.0.rb'
:roll:

To check the file really exists use this in the Ruby Console
File.exist?(File.join(Sketchup.find_support_file('Plugins'),'component_edit_window_v1.0.rb')) if 'false' then 'there's a rabbit away'!

If you have Vista or Win7 and don't have full permission to the subfolders within the Sketchup folder weird things can happen - you think you've added a file but the OS has actually put it into a side-folder - the 'Compatibility Files' issue... If this is the case look to see if there's a button of that name in the top window bars... Fix your permissions for all folders within the Sketchup folder so it doesn't recur...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby artofseeing » Wed Jul 06, 2011 11:44 am

twas indeed the permission issue.

both code snippets (load and file exist) put TRUE,
so now it works.:)
thanks alot!

thats what i too call STREAMLINING!!

thanks a lot
0
as long as there is a voyage away, there's always a journey back...


http://artofseeing.carbonmade.com

artofseeing 
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby pilou » Wed Jul 06, 2011 11:49 am

you can now use this cool plugin by Sdmitch
Replace randomly components ;)
(or not random if there is only one as source ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby pitrak » Mon Aug 22, 2011 10:47 am

I've just tested the plugin on SU8 (win7 32bit) and it only works for groups, not components - the new SU window just doesn't load.
Any suggestions?
0

pitrak 
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby derei » Thu Oct 20, 2011 7:13 am

It doesn't work for me :(
I tried to use it, but I get this error in console:

Error: #<NoMethodError: undefined method `definition' for #<Sketchup::Group:0xe7a4c58>>
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/component_edit_window_v1.0.rb:61:in `atelier_edit_instance'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/component_edit_window_v1.0.rb:60:in `each'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/component_edit_window_v1.0.rb:60:in `atelier_edit_instance'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/component_edit_window_v1.0.rb:124
(eval):3:in `call'
(eval):3:in `call'
(eval):1:in `get_New_Commands'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/component_edit_window_v1.0.rb:61:in `call'
C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/component_edit_window_v1.0.rb:61
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby TIG » Thu Oct 20, 2011 9:51 am

dereeei

Edit the .rb file at lines #55-56 using Notepad or similar plain text editor
Change

all_instances=componentdefinition.instances
if all_instances[0]==nil


to read

all_instances=cnt_instance.definition.instances
if all_instances.length==1


this will avoid the potential glitch, which wrongly looks at the "model.defintions[0]" instances rather than the selected instance's definition's instances - and which might inadvertently throw up a 'group', which then won't have a ".definition" method in the API...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.0 12262010

Postby derei » Fri Oct 21, 2011 10:08 am

TIG wrote:dereeei

Edit the .rb file at lines #55-56 using Notepad or similar plain text editor

Thank you very much. All is fine.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] Component Edit Window v1.1 12032011

Postby TIG » Sat Dec 03, 2011 6:34 pm

We've decided to post an updated version of this useful tool.
It corrects a rare glitch reported the the recent post.
Get the updated version from here viewtopic.php?p=296715#p296715
As you probably know, sadly the script's author died a few weeks ago, he would have done it if he could :(
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.2 12062011

Postby TIG » Tue Dec 06, 2011 12:35 pm

Here's a version that attempts to fix a glitch on the MAC, deleting temp files
Please remember to name components without characters that mess with system like NO /\:<>?* or accented characters etc...
Get the updated version from here viewtopic.php?p=296715#p296715

As you probably know, sadly the script's author died a few weeks ago, he would have done fixed this if he could :(
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.2 12062011

Postby jeff hammond » Tue Dec 06, 2011 3:14 pm

tested new version on mac. (v1.2)

there's no ruby message this time (re: that other thread discussing this)

i named a component 'test'
context menu -> component edit window
popup "insert instance: test" -> OK (in the previous version, after clicking OK is when the error message appeared in the ruby console)
nada
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.2 12062011

Postby TIG » Tue Dec 06, 2011 3:58 pm

Sorry Jeff... It's not my baby and I have a zillion other things to do... I think we stick here for now :cry:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.2 12062011

Postby jeff hammond » Tue Dec 06, 2011 4:59 pm

TIG wrote:Sorry Jeff... It's not my baby and I have a zillion other things to do... I think we stick here for now :cry:


nah.. it's all good..
i'll make a macro later today that does this so i can try out it's functionality in real world use.. i'll post my thoughts on it afterwards
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.3 12072011

Postby TIG » Wed Dec 07, 2011 10:56 am

I've made several adjustments to the code, so it should now run on MAC OK.
Here's v1.3 viewtopic.php?p=296715#p296715

Please remove all earlier versions from your Plugins folder...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.3 12072011

Postby jeff hammond » Thu Dec 08, 2011 3:36 am

hey Tig,

it's getting close..
the new window open's with the component exploded and it's ready to edit..

the problem now is getting it back into the original window.. saving the EDIT and closing does nothing.. (and i tried all sorts of different ways of closing the window and saving..)

there is a file being created at:
/private/var/folders/yn/jr1p5r352bb_031xsl6c3r7c0000gn/T/testbox-EDIT_WINDOW.skp

so that part is working.. i did notice that upon saving i also had a file in the same location named testbox-EDIT_WINDOW~.skp
the tilde ~ represents a backup .skp on mac (we don't have .skb)...
so i turned off my backup preference meaning the original testbox-EDIT_WINDOW.skp would be overwritten with the new edits upon saving but still no luck..

not sure how you're going to figure this one out for mac -without having a mac to test on - since we have only the one instance of sketchup open at any given time.. ;)

i did make a macro that does what this script is doing and it turned out pretty cool.. I'm not sure how much i'll use it but i can see the benefit..
i'm sure it's a bit more primitive than ruby.. mostly just uses keystrokes/menu items but it's fast and works well..
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.3 12072011

Postby TIG » Thu Dec 08, 2011 12:06 pm

It'd be easy to remove the ~.SKP [MAC-SKB] file, just as the SKB is removed on the PC...
BUT when you Save the EDIT_WIDOW version it should auto-close and the other original SKP window underneath should be still open and a dialog pop up asking you if you want to update the Component.
On OK it updates it and the temp SKP/SKB are removed from the temp folder...
If you just Close the EDIT_WINDOW version then you should just revert to the original SKP window underneath it, with not changes or prompts and the temp files removed.
What's happening on your MAC ?
Does the original window stay open ?
On a PC the second SKP opens an 'edit' window above the original...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Component Edit Window v1.3 12072011

Postby driven » Thu Dec 08, 2011 1:02 pm

TIG wrote:It'd be easy to remove the ~.SKP [MAC-SKB] file, just as the SKB is removed on the PC...

What's happening on your MAC ? It's Group#[*]~.skp in -TMP- folder and on save then makes Group#[*].skp also in -TMP- folder.

Neither are 'purged' from the -TMP- folder on close or restart.
TIG wrote:BUT when you Save the EDIT_WIDOW version it should auto-close and the other original SKP window underneath should be still open and a dialog pop up asking you if you want to update the Component.
On OK it updates it and the temp SKP/SKB are removed from the temp folder...

What's happening on your MAC ? No auto close, just saves. The original is underneath oblivious to changes. Not bought forward, no pop up.
TIG wrote:If you just Close the EDIT_WINDOW version then you should just revert to the original SKP window underneath it, with not changes or prompts and the temp files removed.

What's happening on your MAC ? Same, but files remain.
TIG wrote:What's happening on your MAC ?
Does the original window stay open ?
On a PC the second SKP opens an 'edit' window above the original...


Yes, window stays open.
Yes, above original.
also...
After reopening the original drawing, if you select the same group again, it opens the pre-existing drawing from -TMP-

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 28 guests

Visit our sponsors: