sketchucation logo sketchucation
    • Login
    1. Home
    2. fpmalard
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    F
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 19
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Get current OS information

      Tks, worked fine.
      Fernando.

      posted in Developers' Forum
      F
      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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Extensions & Applications Discussions
      F
      fpmalard
    • 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\HELPDIR

      Is there a more secure way to find where SketchUp was installed?

      Regards,
      Fernando.

      posted in Extensions & Applications Discussions extensions
      F
      fpmalard
    • 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>
      
      
      

      xml1.jpg


      xml2.jpg

      posted in Developers' Forum
      F
      fpmalard
    • RE: XML Attribute

      Todd, I'm using this one:

      404 Not Found

      favicon

      (www.crai.archi.fr)

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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

      posted in Developers' Forum
      F
      fpmalard
    • RE: SU view inside WebDialog

      Hi Chris,

      Sure, if you can tell me that would be great!!!
      Thank you.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Português
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in Developers' Forum
      F
      fpmalard
    • 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.

      posted in SketchUp Discussions sketchup
      F
      fpmalard
    • 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.

      posted in Português
      F
      fpmalard
    • 1 / 1