[Code] ComponentInstance-add_entities v1.9
-
I run into a problem when I use add_entities from a startup-ruby.
The code line:@kombi_group_sel_def.instances[0].add_entities(@kombi_group_list)throws an error : undefined method `parent' for nil:NilClass
My ruby (zAutostart.rb) loads after the ComponentInstance-add_entities.rb
When I disable the call in my ruby and start the command from the console it runs without problems.
-
Are you sure you have an instance of that definition in your model?
-
@thomthom said:
Are you sure you have an instance of that definition in your model?
Yes, because when I outcomment my call and type it in the console after start-complete it works.
Therefor I build just a workaround:
wsh = WIN32OLE.new('Wscript.Shell') if wsh.AppActivate(skpbasename+".skp - SketchUp") sleep(1) wsh.SendKeys('{F2}') sleep(1) wsh.SendKeys('convert_acad_import{ENTER}') endSeems that ruby's on startup have problems to use other stuff from other startup-rubys.
-
@hpw said:
Seems that ruby's on startup have problems to use other stuff from other startup-rubys.
Hm.. maybe you're calling a ruby that isn't loaded. Have you added an
requirestatement for all the rubys you depend on? -
Cannot be true, because the error come from inside the add_entities-code.
Otherwise the error would tell about unknown method. -
Maybe things aren't ready immediately when SU loads the plugins...
Have you tried using a timer to delay the execution of your script instead of having to send keystrokes`? -
require 'toggleWindows.rb' ?
-
@thomthom said:
Maybe things aren't ready immediately when SU loads the plugins...
Have you tried using a timer to delay the execution of your script instead of having to send keystrokes`?I tried a 'sleep' with some diferent values without any success.
@tig said:
require 'toggleWindows.rb' ?
I had it yet for closing the outliner.
With my workaround it is working fine now.
(Automated DWG-Creation and SKP-Conversion(Acad-Blocks to SU-DC with non-editable prop) in a Batch process.) -
@hpw said:
I tried a 'sleep' with some diferent values without any success.
sleep prevents everything else to process. If you use a timer you allow the rest to continue processing.
-
v1.7 is now available - now any Attribute Dictionaries the Definition might have are kept when the Definition is reworked with the new entities...
http://forums.sketchucation.com/viewtopic.php?p=145009#p145009
.
-
Using 1.7 instead of 1.6 gives me this error:
@unknownuser said:
convert_acad_import
Error: #<NoMethodError: C:/Programme/Google/Google SketchUp 7/Plugins/ComponentInstance-add_entities17.rb:188:inadd_entities': undefined methodeach' for nil:NilClass>
C:/Programme/Google/Google SketchUp 7/Plugins/ComponentInstance-add_entities17.rb:188 -
I've check it out...
School boy error ! Now fixed with v1.8...
http://forums.sketchucation.com/viewtopic.php?p=145009#p145009 -
Thanks for the quick fix.
Working correctly again! -
Here's v1.9 http://forums.sketchucation.com/viewtopic.php?p=145009#p145009
Copies over Instance Attributes if copy making set...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement