What Windows version are you using?
(I want to get to the actual cause of this, fixing the actual problem instead of patching the symptom - which is why I need to reproduce this.)
What Windows version are you using?
(I want to get to the actual cause of this, fixing the actual problem instead of patching the symptom - which is why I need to reproduce this.)
@tig said:
On PC and MAC I now get this issue whenever SketchUp starts
@unknownuser said:Error Loading File C:/Program Files/SketchUp/SketchUp 2013/Plugins/TT_Lib2/core.rb
uninitialized constant TT::System
Error Loading File TT_Lib2.rb
uninitialized constant TT::System
One step forward one back.
I tried with a fresh install of TT_Lib2 on SU8 and SU2013 - under SU8 I never saw the error. Under SU2013 I saw the error when I had the console open when I installed. However, when I restarted SU there was no errors and everything was working fine... :s
I haven't had time to try this, but just some first glance generic observations:
// Coll.h
typedef unsigned long VALUE;
typedef unsigned long ID;
Why are you typedefing these? It'd be much safer to include the Ruby headers for this - as the type for VALUE and ID might vary from Ruby version to Ruby version.
void Coll;;Init_SkpCol()
{
VALUE rModule = rb_define_module("CColl");
rCollClass = rb_define_class_under(rModule, "Coll", rb_cObject);
rb_define_method(rCollClass, "initialize", VALUEFUNC(_wrap_initialize), 1);
rb_define_singleton_method(rCollClass, "new", VALUEFUNC(_wrap_new), -1);
rb_define_method(rCollClass, "load_model", VALUEFUNC(_wrap_load_model), 1);
}
Using new to allocate C data is a very old way of doing it and causes some complications when one want to create new instances. SketchUp has been using this way of initializing as well, which caused me some headache a while ago.
You can read it on StackOverflow along with links that describes the new way of doing this: http://stackoverflow.com/a/9946578/486990
This doesn't address your original questions, but I just wanted to let you know.
Can you describe more where you where seeing your errors etc? It's a bit daunting to jump straight into code you know nothing about.
Maybe... I thought Ruby was able to deal with circular require, but I've had cases where it seem to cause problems. This might be one of them - I introduced the system.rb require to core.rb recently.
Hard to tell without seeing any code. If it proprietary code or something you can add to GitHub?
What are you point to anyway?
Are you wrapping your C/C++ object in the Ruby objects?
Do you make sure to account for Ruby exceptions that will long jump and possibly make you skip some cleanup methods?
Are you using old-school pointers or smart pointers?
Thanks for the reports TIG. I'll dig into it. I need to make some emergency patches for that other version anyway as well.
@tig said:
Also you have not fixed the issue of a 'mock Extension' like your Lib calling its own file, which breaks the listing in the SketchUcation 'Extensions Manager' dialog, where it always appears disabled, even though it is enabled.
Huh? I changed to to load core.rb ...
I didn't want to use a dummy file as I wouldn't trust that to not display an error.
hm.. that looks like a SCF redirection error....
You try to search the RB files for "class Sketchup::Group" or "def copy" - hoping the culprit is not scrambled. Might same you some investigation time.
Do you have the same plugins installed in all the SketchUp versions. sounds like you are suddenly getting a nil from @group_stair.copy - there might be some plugins that override this and change it's behaviour.
I remembered I'd been messing around with this myself a while back. For reference:
https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-220
What if there are multiple SketchUp windows open with the Ruby Console...?
Ah! Right. Thanks for confirming that. I only hope that forcing a compatibility IE10 mode will return the use of the font-list.
Windows 7 eyh... then IE11 might be the culprit. I might be lucky and be able to force the webdialog to user IE10 compatibility mode.
@doppel said:
Nice & Useful plugin!!! thanks for your work.
But since the last version of TT_Lib², i always have this message on Sketchup starts :
"TT_Lib² detected that some of the files in SketchUp's plugin folder has ended up
in Window's Virtual Store. It happens because of insufficint permissions for the
plugin folder. Please move the files into the real Plugins folder."TT Lib² v.2.9.4
Internet Explorer 11
Sketchup 8EDIT : uninstall et install TT Lib². The message doesn't appeared anymore.
But now, when I start the plugin, i have a message with an error script about the file base.js. And whatever i click yes or no, i can't choose my font![]()
The VirtualStore warning - did you follow its instructions? Move the files from Virtual Store to the proper Plugins folder?
You unintalled TT_Lib2? Then 3D Text Editor wont' work. (But yet you indicate it does? This could be a result of the files in the VirtualStore.)
Regarding the Javascript error, do you have Windows 8? I've gotten reports from Windows 8 users that this plugin doesn't work for them. But I'm not sure if it's Window 8 or IE11...
A "line" in the Ruby API means something very different from an Edge. The Geom module instruction gives you examples that a line can be an array of two point or an array of a point and a vector. Lines and planes are infinite.
If you want to see if two edges intersect you first use the edge'slines to see if they intersect, then you must ensure the resulting point in between the edges vertices.
Geom.intersect_line_line(edge1.line, edge2.line)
(Btw, no space between method name and parentheses. Ruby yields warnings about this and they should not be ignored. They are potential source of bugs.)
Unfortunately there is one inconsistency in the Ruby API regarding line vs edge, Entities.add_line - it should have been named Entities.add_edge. Other than that a line and edge is very different concepts.
You could use the Geom module - intersect a line with a line - will give you a point.
http://www.sketchup.com/intl/en/developer/docs/ourdoc/geom.php#intersect_line_line
Sorry, the official name is "SketchUp C API". "SLAPI" was just an acronym thrown around before I begun which has stuck with me.
Yes, creating entities in SketchUp gets slower the more entities you already have in the collection. It's an annoying known issue.
If your profiling indicate that it's the call to the Ruby API methods that consume the most time then the only thing I can suggest that I know for sure improves performance is to use bulk methods whenever possible. For instance, when erasing multiple entities, call Entities.erase_entities instead of Entity.erase!. Same thing for transforming and modifying the selection.
Beyond that I don't know how much more you can do. It might be on us. But as I said, using SLAPI to generate geometry is something I've been very curious to try out myself. But we currently have done no performance comparisons. Ideally it shouldn't be far away from the performance we get internally.