🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download
  • How should i judge points can construct face or not

    7
    0 評價
    7 貼文
    610 瀏覽
    tt_suT
    @dan rathbun said: My point remains valid. You CAN see the code. You can see what exceptions the API methods raise internally themselves and their messages for ArgumentError and TypeError exceptions. It is in fact not easy to see where all the errors are raised from. I was struggling with that the other day while I was working on an issue. There are a lot of utility methods that might raise errors and it's not easy to see all the code paths. I didn't intent to make an excuse to not so anything, but the majority of the API was made many years ago - long before anyone on my team was around. Tracing down all of them would be a lot of work. Would have been easier had it been done since the design, but alas. Just wanted to give some insight to why things are such as they are. It doesn't mean we don't agree with you. That the documentation is not the best is well known, and you know I've ranted for years about it. One thing we really do want is a new documentation site - a new developer site.
  • Plugin for changing radius of multiple circles

    8
    0 評價
    8 貼文
    715 瀏覽
    C
    I didn't know you could scale a cylinder like that. It's handy to know. I don't know how to do that in ruby though - I tried scaling all 24 faces in the x,y axes using the centre of the cylinder, but unfortunately that didn't work. I also don't know why the model gets corrupted when I run the script and not when others do, I get the same results in 2013 Pro too. Maybe its a Mac issue. If you have any more ideas, let me know, otherwise I'll just have to live with it
  • Clients <--> Server Communication (Sockets?)

    24
    0 評價
    24 貼文
    6k 瀏覽
    Dan RathbunD
    @dan rathbun said: When I first try it under Win7 (with Comodo,) the error message is: Error: #<Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. - connect(2)> I disabled Anti-Virus, Sandboxing and Firewall and still get same error. Perhaps we cannot use "localhost" as a server ? Maybe need to start a virtual server, WEBrick or something ?
  • Program needs Messagebox to complete Scene Up Date

    3
    0 評價
    3 貼文
    295 瀏覽
    K
    Thanks TIG after understanding what you were saying I found a solution. I discovered that if the view was set to Front View before the program started the pages all updated correctly without the UI.messagebox delay. By using code from Extended Standard Views, Chris Fullmer I was able to achieve automatic scene updates. I was not comfortable doing this so I compromised by adding the UI.messagebox to the first page only and then the rest of the pages updated correctly. To summarize: Use new_camera = new_camera.set eye, target, up Set to desired View or as I did use Sketchup.send_action "viewFront:"with a UI.messageboxto wait for the update. Use status = page.update(127) in place of Sketchup.send_action "pageUpdate:" thanks Keith
  • My ruby read write file error when loading them

    3
    0 評價
    3 貼文
    1k 瀏覽
    dukejazzD
    Thanks Tig load('somefile.txt') it's was something simple now errors and fix menu's begone I fixing my massive inputbox and Var array (to a eazier to use floting WebDialog for inputing and smaller number of data arays need to control my processing )
  • Get the Name attribute ( error )

    3
    0 評價
    3 貼文
    367 瀏覽
    G
    The thing is that when downloading from the Components window real component I can get the values of any attribute (and there are about 20) except for the value of the Name attribute.
  • Iterate selection

    3
    0 評價
    3 貼文
    391 瀏覽
    F
    Thanks Anton_s! Even though I'm still trying to figure out what and how your code works it does work perfectly!
  • Sketchup to database

    2
    0 評價
    2 貼文
    385 瀏覽
    TIGT
    I've moved your post to the Developers' Forum. You are likely to get the attention you seek, and help relies to questions here... It is possible to write Ruby whch will read in a file, from that make geometry, and then export data back into a file... A few tips... There are some importer Plugin examples you should find and study... It's much easiest to use 'plain text' CSV rather than binary XLS etc... Obviously the file's exact format needs to be consistent and readily readable - usually points are make X,Y,Z one per line in the file, but if you want to define lines, then perhaps, X1,Y1,Z1,X2,Y2,Z2 - i.e. the line's [aka 'Edge'] start and end one per line in the file. You also need to consider the 'units' the file in in and how that translates to SketchUp - which always use inches as its base-units... There are also already some Plugin examples of 'cut-list'and similar exporters [CSV]...
  • Two-point perspective from API

    3
    0 評價
    3 貼文
    781 瀏覽
    tt_suT
    I'm afraid that's a known limitation. We have an issue written up for it though. I'll add a reference to this thread to it.
  • Entity Attribute !?

    9
    0 評價
    9 貼文
    573 瀏覽
    mtripleM
    thx u all. that was useful ill replay since i do some changes.
  • SecureRandom slow

    10
    0 評價
    10 貼文
    880 瀏覽
    jiminy-billy-bobJ
    @tt_su said: You just need something random enough. Using the hash of the component name might be good enough for your use. Current definition name and time should give you a different hash per component name per object. Yeah I was looking at something like that. But Dan's solution is simpler and seems so obvious! smack on the forehead
  • SU Gui toolkits

    5
    0 評價
    5 貼文
    445 瀏覽
    Dan RathbunD
    @billw said: Alas WxSU has not worked for a long time with Sketchup ... I would be more than happy if Trimble implemented something similar to wxsu. I looked into this recently. The issue is with WxWidgets (used by WxSU,) .. I think that the latest version for Ruby 2.x, is still unstable, and is not out of beta. (It might not even compile currently.) Even the old version has not been worked on in awhile. Another issue is that the top level window needs to be a WxWidgets class window, which the SketchUp app window is not. WxSU did a clunky "fix" by re-assigning the SketchUp app window to be a child window, of an invisible WxWdigets WxFrame. This can be done on Windows (at least XP,) but probably not on Mac.
  • PagesObserver.onElementAdded

    3
    0 評價
    3 貼文
    275 瀏覽
    K
    Thanks Dan I had finally figured that out and then I tried different observers since my post and I don't think the overhead is worth it. If the user forgets to move the dim to the dwg layer it only means there will be stray dim in other dwg scenes. I am thinking of adding a note when the dwg scene is first made to remind the user that added dim will need to be placed on the dwg layer. Keith
  • C SDK - How to get reference for the camera object(s)?

    7
    0 評價
    7 貼文
    538 瀏覽
    G
    Thank you for checking it.
  • Upgrading plugins to Ruby 2.0 for SketchUp 2014

    43
    0 評價
    43 貼文
    8k 瀏覽
    tt_suT
    Your force encoding example will only work if the input text file (CSV) file is ISO-8859-1. ISO-8859-1 is all 8bit per character. However, if you open a file that is saved with UTF-8 encoding and it contains characters over the ASCII range (127) then there will be multi-byte characters - when you then force ISO-8859-1 encoding and convert that to UTF-8 you will mangle the characters. If you have no idea or control over the input data then I would try to use a try/catch approach of first reading the file in what is more likely for the file to be encoded in. If you get encoding errors thrown which you can catch and try the next likely encoding. You can then fall back to just reading it as binary: if RUBY_VERSION.to_f > 1.8 filemode << ';ASCII-8BIT' end File.open(file_name, filemode) {|file| file.seek(80, IO;;SEEK_SET) face_count = file.read(4).unpack('i')[0] } Look at these errors and see if they might be thrown: Encoding;;CompatibilityError Encoding;;ConverterNotFoundError Encoding;;InvalidByteSequenceError Encoding;;UndefinedConversionError EncodingError If you are not familiar with Unicode and how it's represented in byte data I would recommend reading up on that as well. The reason it has worked for you so far has probably been that you have had ASCII compatible data. UTF-8 is byte compatible with ASCII where it uses only one byte per character - but the moment you go outside the ASCII (US-ASCII to be precise) it get multibyte characters. For your testing purposes I would strongly recommend you test with non-english characters. For good measure make sure you go outside of European languages as well, try Japanese or Chinese for instance which might be four byte per characters.
  • [code] SketchupExtension and rbs rubies

    10
    0 評價
    10 貼文
    5k 瀏覽
    Dan RathbunD
    WARNING: This is an OLD topic thread. The SketchupExtension class has been revised (at least) twice since this topic was written.
  • Override the alt-key in a class ??

    3
    0 評價
    3 貼文
    315 瀏覽
    fredo6F
    @artmusicstudio said: is it possible to override the native alt-function (menu-hi-lite) temporarily within a tool This is possible for ALT. You need to return true in the onKeyUp method for the case of key == ALT_MODIFIER_KEY. Actually, returning true seems to prevent bubbling. This is also a way to prevent characters to go to the VCB Fredo
  • How to load all RBS files ?

    8
    0 評價
    8 貼文
    3k 瀏覽
    A
    thanks for the answer Pingpink. somebody opened a thread about your Plugin in the Plugins sections of Sketchucation just the other day. Can you please post more info there? http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=58694%26amp;p=534451#p534229
  • [Solved]Full-Screen Sketchup on Mac

    6
    0 評價
    6 貼文
    575 瀏覽
    D
    Oh well, thanks anyway guys
  • SU 2014 Validtiy Check issues

    16
    0 評價
    16 貼文
    1k 瀏覽
    T
    @dan rathbun said: I remember that the layer name of 0 was changed from language localized names to "Layer0" for all language editions at some point. (We would think the validity check would fix this, in newer SketchUp versions.) Perhaps unicode characters are causing issues in layer names ? I'm wondering if the following code I'm using might be the cause? layers=model.layers layers.add (@frame) activelayer=model.active_layer=layers[@frame] layer=model.active_layer #code that places stuff on layer frame #goes here #at the end of this routine I reset layer # Reset layer back to default layer [0] layers = model.layers activelayer = model.active_layer=layers[0] layer = model.active_layer

Advertisement