Urasik Extensions | Lots of new extensions to check out Learn More

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Load errors for several rubys

    9
    0 Szavazatok
    9 Hozzászólások
    2k Megtekintések
    fredo6F
    @dermotmoconnor You were having a very old version of LibFredo6 (version 3.7, whereas current version is 6.9) and also RoundCorner. I don't know where, in 2016, you got them, if these are new installation. Anyway, that's why it did not work. Fredo
  • Attributes (auto updating)

    5
    0 Szavazatok
    5 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @thomthom said: @medeek said: Howevever, I can't seem to figure out how this attribute is automatically updating. I came across some code not too long ago that could explain this - but there is no documentation for this. SketchUp seem to apply transformations to Geom::Point3d and Geom::Vector3d object stored in attributes. This might be what you want some times - other times if you don't want it, store them as arrays. Which is basically what I said in the duplicate thread in the SketchUp forum, ... http://forums.sketchup.com/t/attributes-that-auto-update/27840 ... which has gone beyond the original questions.
  • Staircase builder - strange scaling behaviour - Help!

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    D
    Staircase builder fixed! Fixed!
  • Architectural plugins

    17
    0 Szavazatok
    17 Hozzászólások
    5k Megtekintések
    D
    Staircase builder has been revised and some bugs fixed. Try it out! db1stairbuilder.rb
  • Getting entity information in onEraseEntity observer

    2
    0 Szavazatok
    2 Hozzászólások
    674 Megtekintések
    Dan RathbunD
    @smeyers said: I am trying to use the onEraseEntity observer, ... To be precise, this is a callback method name, of the Sketchup::EntityObserver class (and subclasses.) @smeyers said: ... which I have placed on the component, to look at the location of the entity being erased ... Okay then, it follows that at the time you've attached the observer, you should have a reference to the component instance, ... which means you can get a reference to the instance's transformation, and store it as an instance attribute of YOUR observer instance (assuming each component instance you attach a separate new observer instance to.) And then, also add an onChangeEntity callback method, that compares the current instance's transformation with the one that was stored in the observer, and if they are different, then the instance was moved, rotated, etc., so update the stored transformation in observer instance. THEN,... later when the onEraseEntity callback is fired, you'll have a copy of the deleted instance's transform stored right there in the observer instance (that is being called.) You do this by passing the component instance's transform into your observer subclass' new() constructor, which passes it into the new instance's initialize() method, (after the object has been created,) where you assign it to an instance variable. module Author;;SomePlugin class NiftyEntitySpy < Sketchup;;EntityObserver attr_accessor(;transform) def initialize(trans_arg) @transform = trans_arg end def onChangeEntity(obj) return unless obj.respond_to?(;transformation) if obj.transformation.to_a != @transform.to_a transform=(obj.transformation) end end def onEraseEntity(obj) # obj is invalid here ! # # Use transform() method or @transform reference directly, BUT # beware of making model changes inside observer callbacks !!! # end end # class # Somewhere in the code, attach a new observer instance, # to each component instance to be watched; inst.add_observer( NiftyEntitySpy;;new(inst.transformation) ) end
  • SketchUpAPI.dll - 32 and 64 bit

    4
    0 Szavazatok
    4 Hozzászólások
    2k Megtekintések
    TIGT
    Why not separate the 'bitness' at the download-installer level, i.e. offer 32/64 bit installers ? Then what the client downlands is what they expect ? If you want to remain 'clever'... then check the bitness when the exe runs [installer-level check] and have two separate installer exe's running from those...
  • Applying Material or Color to Group

    3
    0 Szavazatok
    3 Hozzászólások
    843 Megtekintések
    TIGT
    group.material=material Where the given material is a reference to a material already available in the model, or perhaps it's the name of an existing material, or the name of one of the standard 'color' - that might be not yet loaded: So e.g. material=Sketchup.active_model.materials['truss_wood']Where material returns 'nil' if it's not found, or a reference to that named material otherwise. Or alternatively: material='truss_wood' which will work if you know that the material named 'truss_wood' is already in the model, or perhaps... material='brown' Which uses the material named 'brown', or it makes the new material then uses it otherwise. There is a preset list of 'colors' [à la html]: http://www.sketchup.com/intl/en/developer/docs/ourdoc/color If you want a material with another color or transparent, or a texture, then you must add it to the model.materials before referencing it. http://www.sketchup.com/intl/en/developer/docs/ourdoc/materials#add You then create a new color and apply it to that new material, which by default would be black with no transparency [0,0,0,0] http://www.sketchup.com/intl/en/developer/docs/ourdoc/material#color= If you also want to add a texture to the material, use http://www.sketchup.com/intl/en/developer/docs/ourdoc/material#texture= Which specifies the image file to use, then you can edit the texture's details with texture=material.texture Using:http://www.sketchup.com/intl/en/developer/docs/ourdoc/texture#size= etc...
  • Selection error?? with Ruby API

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    No pattern. The various ways that the user can manipulate the selection set makes any order meaningless. Ie: single pick, single pick + CTRL, single pick + SHIFT, Window Right-to-Left pick, Window Right-to-Left pick + CTRL, Window Right-to-Left pick + SHIFT, Window Left-to-Right pick, Window Left-to-Right pick + CTRL, and Window Left-to-Right pick + SHIFT. Any of these, followed by any other number of them, in whatever order the user may use them, creates a selection set in which the pick order has no importance. That said, ... You question indicates you are perhaps trying to program a workflow that would better be implemented as a Ruby Tool, using a Sketchup::PickHelper. Another alternative might be a Sketchup::SelectionObserver subclass.
  • Quad chamfer corner question

    10
    0 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    thomthomT
    I guess Fredo is occupied with Animator these days. It would be great if more extensions could be made available on GitHub, BitBucket with open source licenses - allowing people to add to existing extensions instead of re-implementing similar functions.
  • Auto close UI.messagebox (Bug or feature?)

    8
    0 Szavazatok
    8 Hozzászólások
    2k Megtekintések
    D
    @thomthom said: What would the use case for that be? If you know in advance that there will be long operation, you can prepare a message box which will come after e.g. 5-10 min. " It seems to much time to process, do you want to abort or go ahead?" The UI:messagebox is suspending the operation and the code is continuing if it is closed. (At least in windows...) But if the user is not responding for e.g. 30-60sec the message box will close automaticly and the code is continuing to process. You can't use webdialog, because in long operation SU (including WD) is not responding at all. For sure there is other workaround, or possible to do your code on other way, but this could be an "easy" solution... (I'm just an amateur engineer, not a programmer ... )
  • Minimum dimension of a component

    4
    0 Szavazatok
    4 Hozzászólások
    784 Megtekintések
    Dan RathbunD
    My solution: def thickness(obj) ents =( obj.definition.entities rescue obj.entities ) tran =( obj.transformation rescue IDENTITY ) edges = ents.grep(Sketchup;;Edge).find_all {|e| e.start.position == ORIGIN || e.end.position == ORIGIN } if edges.size < 3 return 0.to_l # not a 3D object or edges array empty end shortest = edges.min_by {|e| e.length } shortest.start.position.transform(tran).distance( shortest.end.position.transform(tran) ) end This should work with an argument that is a definition, group or component instance. If a ComponentDefinition is passed, the transform will be the IDENTITY transform, otherwise an instance or group will be it's transform (which also might be == IDENTITY.) Within the entities the local origin is == ORIGIN, so there is no need to create any temporary point object for comparison, just to select the 3 edges. Once we have the shortest (untransformed) edge, we apply the transformation to both it's vertex positions, to account for any rotation and scaling (either uniform or not.) Now, this assumes that the shortest definition edge is always to be considered the thickness, even in the instances. But what if someone does non-uniform scaling and makes one of the longer edges shorter than the one that is supposed to be the shortest ? I suppose, if you control the definitions, you could attach an attribute to the "thickness" edge, and find it by attribute.
  • Determining Corner Points

    4
    0 Szavazatok
    4 Hozzászólások
    793 Megtekintések
    TIGT
    Are the original pt1 and pt2 created in the model.active_entities context ? If pt1 is always the ORIGIN then you really only need pt2 ? Why not use a transformation ? You can store the initial truss.transformation.to_a as an attribute with the truss. Then... when you next need to assess the current truss location/rotation just get the current truss.transformation and then modify [transform!] it OR even the saved point [or 2 points] - having adjusted it by the transformation that was stored as it was created - recreated from the attribute array back into a transformation. http://www.sketchup.com/intl/en/developer/docs/ourdoc/transformation
  • [PLEASE HELP] materials

    5
    0 Szavazatok
    5 Hozzászólások
    2k Megtekintések
    T
    Hi people, Able to replace the texture of a object without upsetting the Mapping. But if I duplicate that object, I am unable to assign a different/separate/unique texture where each object can be assigned a different texture image jpeg. I am unable to DE-LINK the image textures of the two objects. Pls Note: I am able to do this only by applying the texture image as a fresh unmapped material and then fix the mapping all over again.
  • Storing Bounding Points

    3
    0 Szavazatok
    3 Hozzászólások
    591 Megtekintések
    G
    I like to keep my data in a structure and I like to save structures to disk and / or store them as a complete record in a dictionary. So you can either parse the file / or parse the dictionary in the same exact way. Actually very simple and extremely future proof as they are key pairs. New versions that introduce new fields (elements) need only provide a reasonable default. I can provide you with examples if you want to PM me.
  • Send mail from Sketchup

    3
    0 Szavazatok
    3 Hozzászólások
    725 Megtekintések
    Dan RathbunD
    And to have an email form filled out, but not automatically sent: UI;;WebDialog;;new( "Email...",true,nil,200,100,300,200,false ).instance_eval { email = "mailto;//someone@example.com"<< "?subject=This%20is%20the%20subject"<< "&cc=someone_else@example.com"<< "&body=This%20is%20the%20body" set_html( "<!DOCTYPE html>\n<html>\n <head>\n </head>\n"<< " <body>\n <br/>"<< " <a id='elink' href='#{email}'>Firing an email!</a>\n"<< " </body>\n"<< "</html>" ) show() { execute_script("elink.click();") } } http://en.wikipedia.org/wiki/Mailto But there must be a registered email client for the system. Ie, it does not work on my machine because I use browser based gmail, and never registered any email client application on this machine. (So for me two error messages popup stating there is no registered email client.)
  • Top Level Component or Group

    4
    0 Szavazatok
    4 Hozzászólások
    738 Megtekintések
    K
    Thanks that worked and after seeing it correct it makes sence. KeitH
  • How to reduce Sketchup

    4
    0 Szavazatok
    4 Hozzászólások
    802 Megtekintések
    TIGT
    You can't do it wholly within Ruby. But you could probably make a set of 'system' calls in Ruby to do it [it'll differ between MAC & PC].
  • Compute Rotation and Scale from Transform Object

    26
    0 Szavazatok
    26 Hozzászólások
    6k Megtekintések
    TIGT
    An olde typo - use 1 for the second test...
  • Towards a complete extension: Good Practices

    5
    0 Szavazatok
    5 Hozzászólások
    741 Megtekintések
    hsmyersH
    @dan rathbun said: Then you'll need to follow: http://extensions.sketchup.com/en/developer_center/ew_developer#rbz I've read through same and I plan to do so again more thoroughly again after I get this next layer of magic nailed down. I think I now understand the two file format well enough to give it a spin in a bit but am momentarily busy prepping prototype parts for shapeways. Its been tool, prototype, tool, proto in a kind of recursive spiral! Need one for the other and round about we go...
  • UI.inputbox with Web Dialog

    5
    0 Szavazatok
    5 Hozzászólások
    1k Megtekintések
    hsmyersH
    @thomthom said: https://github.com/thomthom/SKUI Could you add version to README.md? Pretty please with a cookie?

Advertisement