🏢 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • SketchUp API Documentation for redraw and redraw_with_undo

    2
    0 Votes
    2 Posts
    388 Views
    Dan RathbunD
    No there is no documentation. Technically... DynamicComponents is a Google/Trimble extension. And it is not OpenSource. Practically... it works (and is thought of,) as part of the Sketchup application itself. (The fact that it's written in Ruby, raises some stability issues if a lot of people began messing with it. And.. also, it would run alot faster if it was re-written in C/C++.) What you may not have realized.. is that DC are really just Sketchup::ComponentInstance instances, that have specially named attribute dictionaries and attributes, that are used by the extension, to do nifty things. Because it is an authored extension, it's internal workings are subject to change. Even it's internal methods could change their names, but externally, end-users, and scripters, might interact with them in the same way (or without much change.) So, much of what we know, has come from little tidbits, revealed by the members of the SU Dev team, .. and we can assume, that they have told "the world", what they are comfortable revealing. Or.. it may be that Google was never willing to spend the money, to produce the documentation. Or perhaps.. maybe the Ruby version V1 is the proof of concept... and they always had hopes of "baking it into" the C-side API code. (But just have never had that phase percolate to the top of the "to do" list.) Anyway.. if that happens, who knows what the method names exposed to Ruby might be ?? This latter possibility, is the reason I never attempted (even though I thought about it,) to write a reference manual for DCs myself. (That and I would imagine, they would have to give their "blessing" for it. I'd never do something like that without asking. Wouldn't like it if someone did it to my closed source work, without permission.)
  • Ruby to connect lines and make face?

    4
    0 Votes
    4 Posts
    3k Views
    L
    Using the "K" button will help you view hidden lines quickly. This can help GREATLY with connecting faces. Also it helps you snap components that get confused with the zoom.
  • [Info] Notepad++ : Tip, Tricks & Plugins

    14
    0 Votes
    14 Posts
    7k Views
    Dan RathbunD
    It's quite easy to customize your Right-Click Popup ContextMenu in Notepad++ For this example, we use the SessionManager Plugin by Mike Foster. (The plugin is now up to version 0.6 and works very well now. So update if you have an older version.) I have many project sessions saved, and now start Notepad++ with an empty session, and choose which project I will work on. There are two issues. (1) The "Plugins" menu is huge! And having to go through it to get to the "Session Manager" sub-menu, each time, is a bummer. (2) Even though the "Shortcut Mapper" is powerful, there is no way (that I can find,) to list those that have already been assigned. And a multitude have been! I do not know whether I will interfere with a shortcut that is already in use. So instead, I added a ContextMenu sub-menu: On the main menu: Settings > Edit Popup ContextMenu (Click the OK button to have NPP open your user contextMenu.xml file.) After the file opens, scroll down to the section beginning: <!-- To add plugin commands, ..... --> ... Add just below that comment (and above the lines adding "base64 encode" commands,) the following lines (if your running English and the actual "Session Manager" menu items are in English.): <Item FolderName="Session &Manager" PluginEntryName="Session Manager" PluginCommandItemName="Sessions..." /> <Item FolderName="Session &Manager" PluginEntryName="Session Manager" PluginCommandItemName="Settings..." /> <Item FolderName="Session &Manager" id="0"/> <Item FolderName="Session &Manager" PluginEntryName="Session Manager" PluginCommandItemName="Save current" /> Now.. restart NPP, and you will now have a "Session Manager" submenu on the right-click popup context menu. So launch a session: Right-Click, M, ENTER BUT.. say you do not like the author's menu item names (there are 3 that begin with "S" and Windows' built-in 'starting letter' menu accelerators will not work for items, that are on a menu where other items also begin with the same letter.) No problem ... the contextMenu.xml format allows you to use a different name (and accelerator letter,) than the plugin author used in his "Plugins" sub-menu. Add an ItemNameAs= attribute, to the Item tag. Say that you want the accelerator to be "S" for the "Session Manager" popup sub-menu, and rename the menu items, and specify what accelerator will fire them using &: (I also went up near the top of the file, and changed the accelerator for "Select All" to "A".) <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Sessions..." ItemNameAs="&Control..."/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Settings..." ItemNameAs="&Options..."/> <Item FolderName="&Session Manager" id="0"/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Save current" ItemNameAs="&Save Current Session"/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Help" ItemNameAs="&Help"/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="About..." ItemNameAs="&About..."/> [whoops... fixed the typos, so all the & in the same place.] So I open Notepad++, Right-Click, and press "S" then "C", and choose which of my sessions I will work on. And, on my machine, the context menu now looks like this: [image: VaoK_npp_popup_session_mgr_submenu.png] A last word: The attribute PluginEntryName must be the plugin sub-menu title, as it appears in your localized langauge. The same for the PluginCommandItemName, it must be the sub-menu item you wish to clone, exactly as it appears on the main Plugins > whateverPlugin sub-menu.
  • [Code] Detect Window's VirtualStore

    9
    0 Votes
    9 Posts
    2k Views
    thomthomT
    @dan rathbun said: So did "Run as Administrator" allow you to write files where you wanted, rather than the VirtualStore ?? Didn't try that - because my fileread was triggered by the drag and drop which was prevented. But it'd be worth testing. @dan rathbun said: And.. are you saying that file writing is even more of a P.I.T.B on Win8, than it was in previous versions ?? I don't know - I've always used an administrator account on Vista and Win7 with UAC disabled. I cannot compare because Win8 is the first Windows OS I've tried with default user access. I suspect it's the same as Win7 and Vista, but I need to verify this.
  • C Extension on OSX crashes SU

    18
    0 Votes
    18 Posts
    3k Views
    thomthomT
    @nikus_knx said: @thomthom said: I guess it'd be worth compiling this info into a how-to article... Did you do this? I can't found it... I got a Hello World project tutorial over at BitBucket: https://bitbucket.org/thomthom/sketchup-ruby-c-extension SCF thread related to the tutorial: http://forums.sketchucation.com/viewtopic.php?f=180&t=41077
  • Floorplan app on ipad

    2
    0 Votes
    2 Posts
    277 Views
    S
    I guess my question was whether people thought an application hosted on a desktop and controlled using remote access software from the IPad would be effective. Local IPad developers think it would be too slow. \
  • Output 3d model by small tiles

    4
    0 Votes
    4 Posts
    141 Views
    J
    I still couldn't solve the problem. Could some guru here please help? Thanks a lot.
  • Fastest way to retrieve the corners that make up a face?

    9
    0 Votes
    9 Posts
    223 Views
    thomthomT
    @dan rathbun said: ADD: For some reason, for .. in loops are faster than each block methods. They may be faster - because they don't create a local variable scope - the scope is shared with it's parent scope. Creating variables in Ruby is an expensive operation, so if you create variables within an each loop it's created every time, within a for loop it's reused.
  • Export animation with Ruby

    12
    0 Votes
    12 Posts
    1k Views
    R
    Amazing!! I will dive right into it! Thank you so much for your patience, Dan. I will update my results here (if I make it that far
  • SketchupExtension in a single file

    13
    0 Votes
    13 Posts
    2k Views
    thomthomT
    @dan rathbun said: NO (the above,) will not work because Sketchup::require() and Sketchup::load() do not raise LoadError. They just return false on failure, and 0 on success. (I do have a API bug report filed on this.) They don't raise LoadError ...? That's interesting. My mistake was that I tested the whole thing by loading manually from an external location instead of placing the file in the Plugins folder and having it load at startup. My "simulation" was incorrect.
  • Edit materials from code

    11
    0 Votes
    11 Posts
    135 Views
    D
    this is what I have achieved so far entidad = %(#FF8000)[Sketchup]%(#0040BF)[.active_model.selection][0] curretmaterial = entidad%(#0040BF)[.material] nameM = curretmaterial%(#0040BF)[.name] curretmaterial%(#0040BF)[.color]=[102, 0, 51] curretmaterial%(#0040BF)[.name]=%(#BF8080)["nuevo tono"] I shall be able then apply the recommendations (sorry for bad English)
  • Determine if face is pointing toward center

    3
    0 Votes
    3 Posts
    82 Views
    thomthomT
    Sound more like the model isn't modelled with their normals correct. All 3D software tools will use cause odd results of the normals in the mesh isn't modelled correctly.
  • Can page/scene creation be undone in undo/redo system?

    4
    0 Votes
    4 Posts
    173 Views
    T
    That's the usage I put in - with the second parameter 'true'. It does indeed speed up making many scenes, quite noticeably. I haven't fully characterised how many scenes need to be undone to cause a crash (EDIT - I said originally 'kill' and I realised you might be thinking 'slow down horribly' rather than crash, burn, quit rudely etc) but since 'a few' works OK (except for the damned pages staying in place instead of going away) and 'a few dozen' crashes, I guess it's somewhere in the middle.
  • Closing an open component API

    7
    0 Votes
    7 Posts
    152 Views
    Dan RathbunD
    @tim said: Yeah but you know what it's like - Yes I've been there. Was just teasing. And it takes awhile to get used to how they organized the API.
  • Getting the &quot;circle steps&quot; ???

    11
    0 Votes
    11 Posts
    205 Views
    M
    @tig said: My "ArcCurve-set_segments" tool lets you change the segments of selected Arcs, just as you could using Enity Info on each one... you are also bound by the same limitations - e.g. you can't change the segments if the Arc is part of a 3d object... Argh, that's exactly what I was envisioning to do (a 3D object application). Well it makes sense that it cannot be done on the volume by changing the segments of the generating geometry. I didn't think of that. Thanks for the answers.
  • How to protect your plugins code

    5
    0 Votes
    5 Posts
    1k Views
    Dan RathbunD
    @tlnguyen said: So is there a way to protect our ruby code? and is there a way to remotely control its use? Do you mean license management ? "Control it's use"... in what way(s) ??
  • Ruby API Pages.add bug(s)

    4
    0 Votes
    4 Posts
    103 Views
    T
    Doc and code drifting is quite possibly one of the biggest issues affecting code maintainability. I've never quite got over the idiocy of a few people I've worked with that really took to heart the attitude of "documents and comments? Why do you think it's called 'code'?" Certainly when I was managing a team I didn't let anyone get away with that - at least where I could detect it… An old colleague came up with a pithy way to describe what ought to happen - "don't document the code, code the document!" I didn't know that there is a separation between Page and View; now I do, so thanks for that. The specific problem I had with my code was that with no named page in a fresh drawing simply adding a page, hiding everything, adding my new layer, adding the copy of the selected component and updating the page left an apparently mangled drawing because there was still only one page visible and it no longer had the main model visible. I can see that going down well with anyone trying out a new plugin! As a workaround I've made it add a default new page before adding my 'real' new page so that at least there is no nasty surprise.
  • Integration tool by using paste in place

    15
    0 Votes
    15 Posts
    268 Views
    N
    oh ok! Thanks to all ! I understand now
  • Move or Transform group found using entityByName() script??

    4
    0 Votes
    4 Posts
    112 Views
    L
    Okay, I managed to move entire array of groups however my project didn't save and because I did it after days of trial and error I can't now recreate my snippet but maybe someone knows how I can move that array of groups to another place (if I could get this first step again i should be able to get the rest). I'm pretty sure I used tranformation to get destination but can't figure it out. Please help!!
  • FTP zip file upload

    8
    0 Votes
    8 Posts
    835 Views
    J
    Wow! This is thorough! I can't thank you enough for your insights. You've given me several paths to take as a solution to this. If I can convince users of the plugin to use a full Ruby library and install it, that will limit the number of hoops needed to pass through. Having a prerequisite library doesn't sound all that bad now that it can be easily suggested to potential users of a plugin. Thanks a Million, Dan. I'll keep the community updated on what I go with.

Advertisement