Tks, worked fine.
Fernando.
Posts made by fpmalard
-
Get current OS information
Hello,
How can I get current OS information from inside SKU Ruby code?
I need to find out if I'm running my Ruby code inside either Windows or OSX.Regards,
Fernando. -
RE: SketchUp root folder
Hello Jim,
Actually I need this outside SketchUp.
I'm creating an installation package which need to know where is the Plugins folder.The registry entry:
HKEY_CLASSES_ROOT\TypeLib{FBD46897-D37D-484F-A4BF-B48EE41F0348}\1.0\HELPDIR
seems to be ok.Regards,
Fernando. -
SketchUp root folder
Hello,
How can I get the SketchUp root folder?
Inside Windows (I still haven't tried for OSX), after install SketchUp, no entry is created into windows registry informing the installed folder.The only thing I have found, after you run SketchUp for the first time, is the SKP file extension registration. This adds an entry at registry with the following key:
HKEY_CLASSES_ROOT\SketchUp.Document\shell\open\command
or
HKEY_CLASSES_ROOT\TypeLib{FBD46897-D37D-484F-A4BF-B48EE41F0348}\1.0\HELPDIRIs there a more secure way to find where SketchUp was installed?
Regards,
Fernando. -
RE: XML Attribute
Sure,
Try this XML string:
<?xml version="1.0" encoding="utf-8"?> <soap;Envelope xmlns;xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns;xsd="http://www.w3.org/2001/XMLSchema" xmlns;soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap;Body> <CreateTaskInstance xmlns="http://webservices.ofcdesk.com/"> <sServiceKey>string</sServiceKey> <sSessionKey>string</sSessionKey> </CreateTaskInstance> </soap;Body> </soap;Envelope>
-
RE: XML Attribute
Todd, I'm using this one:
http://www.crai.archi.fr/RubyLibraryDepot/Ruby/Attribs_v1_05.zip
-
RE: XML Attribute
Hi Todd, thank you for your reply.
I'm doing the following steps:
- Insert a simple entity like a circle;
- Right click, Attributes -> Show;
- Add a "Sample" category;
- Add a new Attribute, name as "XML" and value as a XML string;
- Click OK (the XML string appears at the second column of Attribute dialog;
- Click Accept;
- Right click again, Attributes -> Show;
- Error: "Internet Explorer Script Error: Unterminated string constant...Do you want to continue running script on this page?". No matter Yes or No, the dialog stay blank.
I suspect that the attribute data is still there but as Attributes sample uses a Web dialog to display the information the XML string format is causing the error due its special symbols like <,>,",/, etc.
Fernando.
-
XML Attribute
Hello,
I was wondering if it is possible to store a XML string inside an entity's attribute dictionary.
I have tried to do that using Attribs sample but it did not let me add the string (I guess JSON or JScript are failing to validate the string once it has "invalid" symbols). Another possible problem is the string length. I was unable to find the attribute string length limit.Can I do that?
Do I need to store/retrieve this XML string as a binary package? If so, do I need to use pack()?Regards,
Fernando. -
RE: SU view inside WebDialog
Hello,
Actually I was wondering if I can preview an entiy drawing inside the webdialog before create it into current model. This will be used on entities created from parameters like width, length, etc.
As soon as the user change some of these parameters I could show a preview drawing and only after he hits Ok it creates the entity inside current model.
Any ideas?
Regards,
Fernando -
RE: SU view inside WebDialog
Hi Chris,
Sure, if you can tell me that would be great!!!
Thank you. -
How to read/parse XML files inside SU
Hello,
What is the best way to read/parse XML files inside a SU Ruby script?
Do I need a specific XML Ruby library or do SU support this natively?Regards,
Fernando. -
SU view inside WebDialog
Hello,
I was wondering if it is possible to create a WebDialog and display inside it a SU View control to draw entities on the fly inside this view control.
Do SU provide an Active-X control or something like that to be used inside a dialog?
Regards,
Fernando. -
RE: Angle snaps
Fernando, obrigado.
Na verdade eu queria saber como fazer isso usando um script em linguagem Ruby.
Acabei descobrindo:model = Sketchup.active_model manager = model.options manager.each { |provider| if (provider.name == "UnitsOptions") UI.messagebox provider.name provider["AngleSnapEnabled"] = false provider["SnapAngle"] = 8.5 provider.each { |key, value| UI.messagebox key.to_s + " = " + value.to_s } end }
O problema é que ele não aceita valores diferentes dos existentes no snap angle.
De qualquer forma, obrigado.Abraços.
-
RE: Ruby Scrambler -- Myth or Marvel?
Hello, I came from another post I have done myself and was able to find out how to scramble the Ruby sources.
There is an application at the root of SketchUp SDK which is called Scrambler.exe.
You just need to run it from command prompt and pass the name of your Ruby file. It will generate a new file with the same name and RBS extension.
I think this is the best way to protect your routines by now.
Best regards,
Fernando. -
RE: Ruby script encryption
Thanks.
I have found it, there is an application at the root of SketchUp SDK which is called Scrambler.exe.You just need to run it from command prompt and pass the name of your Ruby file. It will generate a new file with the same name and RBS extension.
I think this is the best way to protect your routines by now.
Best regards,
Fernando. -
RE: Ruby script encryption
Hi remus,
I'm asking this because I have downloaded some Ruby scripts for SketchUp and the major part of these .RB files are with the text encrypted and even in this state they load and run fine inside SktechUp.
I though this could be some known tool or application.
Thank you.
-
Ruby script encryption
Hello,
What the best tool and method to encrypt Ruby scripts so they are protected from unwanted editing?
Will a encrypted Ruby script work on both Windows and Mac?
Best regards,
Fernando Malard. -
Angle snaps
Hello,
Is there a way to change the angle snap setting during a command?
I would like to make sure it is running and allow user only to go to some directions.
Something like this:- User clicks at the start point;
- I draw something at the tool view to indicate the possible directions;
- The user is able to only go to these predefined angles.
Any tip on this?
Best regards,
Fernando Malard. -
Angle snaps
Olá pessoal,
Sou novo no SU e na programação Ruby.
Gostaria de saber se tem como ligar/desligar o snap de ângulos e mudar também o valor de intervalo de ângulos desse snap.Obrigado,
Fernando.