ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Transformation / rotate of an existing component

    7
    0 Votes
    7 Posts
    424 Views
    TIGT
    An object like a group has a bounding-box with its XYZ axes a parallel to the groups' internal XYZ axes. So if the geometry inside the group is made parallel to its internal axes then its bounds hug the geometry. If you rotate the group its bounds rotate with it. If you rotate the geometry inside the group then it is rotated relative to the group's internal axes. So although the visible geometry is rotated the bounds stay as they were - now skewed... tr=Geom::Transformation(point, axis, angle) group.transform!(tr) Rotates the group [AND its geometry inside] so the bounds rotate. tr=Geom::Transformation(point, axis, angle) group.entities.transform_entities(tr, group.entities.to_a) Rotates the group geometry inside BUT leaves the group where it was, so the bounds do not rotate - so it is skewed... If you have skewed geometry that is made into a group the group.bounds are skewed relative to the geometry. To fix this first rotate the group then rotate the geometry in the opposite direction [use tr.inverse]. Visually it's unchanged but the bounds now match the geometry and the group is actually rotated... tr=Geom::Transformation(point, axis, angle) group.transform!(tr) group.entities.transform_entities(tr.inverse, group.entities.to_a)
  • Inputbox width, some text hidding

    3
    0 Votes
    3 Posts
    258 Views
    dukejazzD
    @unknownuser said: I have started a plugin with several inputbox following each other and i realised the width of the input box varies mainly with the first line but not really... Easy fix; I think you can move the right inputbox drop down margin by a tab and (n) spaces on the right of largest number in list example 1) 1 tab 6 space lists = ["3.0|0.333333333333333333333330 tab sp sp sp sp sp sp|44.0"] box will now show 0.333333333333333333333330 to the zero place
  • Can I override the basic functionality of pushpull?

    5
    0 Votes
    5 Posts
    425 Views
    B
    Apologies for the delayed response. Here is how a user would use the Plytool (the tool that creates a box/ply) Click on the tool icon. Now click (to mark the first point) and start drawing the ply [image: YZwl_1.png] Stop at another point (which is the second point). Leg go the left click and you have your ply [image: DK4W_2.png] Coming to the questions @tig said: From what you've said you don't actually want to stop the user having the PlushPull tool available to them ? Correct. I don't want to stop the user from using Push/pull but just restrict the user from pushing or pulling on certain kind of faces [e.g - vertical faces only]. @tig said: Limiting the user's choice within your tool of available faces for this pushpulling is a matter of testing a face for its suitability - this can be whatever you want - orientation of face.normal [e.g. only 'up' faces], or faces using a particular material or layer ? That way your own pushpull tool will simply work in limited ways... Yes, this seems like the suitable option to try. I will try this and get back if any questions. Ideally I would have preferred the ability to override pushpull tool (thereby not introducing a new limited version of pushpull tool). But this should do for now. Thanks guys for helping me out and clarifying what is possible and what not.
  • Math-problem

    8
    0 Votes
    8 Posts
    272 Views
    artmusicstudioA
    hi icehuli, that's it! of course, i already had the tanges, so......sometimes it's so clear afterwards... thanx a lot, the method works now! new_line = @entities2.add_line @pfm1, @pfm2 @vector = new_line.line[1] point = [0,0,0] angle = (Math.atan(var4/@run)).radians angle = 360 - (Math.atan(var4/@run)).radians if var5 == "right" tr = Geom;;Transformation.rotation(point,@vector,angle.degrees) @group.entities.transform_entities(tr, @group.entities.to_a) stan
  • Checking for a group?

    15
    0 Votes
    15 Posts
    852 Views
    Dan RathbunD
    @artmusicstudio said: MODULE 01.rb // is it right to put hier 01.rb ??? (the work-name of the ruby) No you cannot use a Numeric expression as a Class or Module name. They must begin with alpha characters, and be title case.
  • Sketchup viewer portable

    3
    0 Votes
    3 Posts
    3k Views
    G
    @dan rathbun said: The viewer writes it's settings into it's own registry hive on PC, so it is separate from the Make or Pro SketchUp settings. These viewer registry settings would be left behind on the workstation, but should not cause any problems. The more important isssue is if the workstation will have all the required libraries already installed on them. Such as the correct version of the C runtime library. Dot NET libraries, etc. thank you for these informations i don't understand everything, but from what i understand, it should be possible to use su viewer in a portable way
  • Adding methods.

    6
    0 Votes
    6 Posts
    261 Views
    tt_suT
    @mptak said: In general Ruby (or Python as well) it seems that you use subclasses but this seems problematic. Yes, though then it's normally in a server environment where you have more control over the environment where your code is run. In SketchUp the user controls the environment and the developer is the guest - flipping the roles.
  • [Tutorial] SketchUp Ruby C Extension

    176
    0 Votes
    176 Posts
    26k Views
    C
    Not allowed to PM yet, but email has been sent
  • Find plane at intersection of 2 vectors

    13
    0 Votes
    13 Posts
    567 Views
    G
    I know exactly what you mean - I've built a lot of curved staircases. The challenge when it comes to modelling is to try an approximate the handrail profile and to manage ( or control ) the distortion. You feather the distortion over a distance so as to minimize it visually.
  • Overlapping detection

    2
    0 Votes
    2 Posts
    202 Views
    jolranJ
    There is BoundingBox.intersect But I gather you want to be more precise than so. So it will cost to calculate intersections for many Groups however you do it. You don't mention if is this is on 1 plane or 3d.
  • [C++SDK] ISkpRenderer

    10
    0 Votes
    10 Posts
    503 Views
    T
    @avariant said: Thanks! Look forward to that day (I hate COM). +1
  • Getting an active page

    9
    0 Votes
    9 Posts
    254 Views
    Dan RathbunD
    I know what he meant.. my arg still stands. Sometimes "active" is appropriate.. other times "selected" is more appropriate. Still other times "current" may seem more appropriate. There is a difference between the terms. They are not direct synonyms.
  • LoopLab Help

    3
    0 Votes
    3 Posts
    251 Views
    tt_suT
    You can collect all the separate loop-segments from the selection and then treat them separately. If you made the assumption that the user only selected one edge in each of the loops he/she wants selected then it's easier - as you just need to iterate each edge in selection and build a loop for each one. But it could be that the user selected multiple segments of a loop, in which you would have to detect this as well. Or, thinking of it, you could just ignore the fact that some are connected, just build the loop anyway and make sure you don't process an edge that's already in a generated loop.
  • Reading SKP thumbnail

    7
    0 Votes
    7 Posts
    350 Views
    tt_suT
    blink -- me neither! I guess I always just skipped over that method...
  • Basic question - groups as array ?

    5
    0 Votes
    5 Posts
    269 Views
    artmusicstudioA
    hi, thank you all, i tried to put my groups in the suggested ways into a loop, but i always get errors. with '@@groups' i would reach all grups, wouldn't i ? i will try to describe the whole problem: i have a defined amount of groups with one basic construction point (thanx dan), the amount changes by user input, so it must be variable, so there may be 2 or 20 @group_handlauf_mitte - groups. @group_handlauf_mitte1 @group_handlauf_mitte2 @group_handlauf_mitte3 @group_handlauf_mitte4 and so on i cannot find out, how can i access those 'group_handlauf_mitte ' groups in a loop to be able to select a group by @group_handlauf_mitte[index].entities. (my index here ist PODESTNR) i also tried to create the group name as a string-combination within a loop for step 1..20 a = "group" + step.tp_s.name a.name = a end but that's obviously not working , too. at the moment i have to define like this: if @podestnr == 1 entities = @group_handlauf_mitte1.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte1.entities elsif @podestnr == 2 entities = @group_handlauf_mitte2.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte2.entities elsif @podestnr == 3 entities = @group_handlauf_mitte3.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte3.entities elsif @podestnr == 4 entities = @group_handlauf_mitte4.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte4.entities end instead of this i would like to make a loop in which STEP decides, which grop's entities will become ENTITIES, but only for those groups, not all groups i have. hopefully i can once understand the syntax for group selection by index, because i could then make the ruby-code many times shorter. in this loop i need the griup name 1,2,3,4 to become dependent from the index MTH model = Sketchup.active_model y1 = 0 - @run ## the overall variables come from earlier code !!! y2 = 0 y3 = @run z = @rise pf = [] for mth in 1..10 entities = @group_handlauf_mitte1.entities ### MTH instead of 1 needed entities.erase_entities entities[0] rl1 = [0, y1, 0] rl2 = [0, y2, z] group = @group_handlauf_mitte1 = entities.add_group ### MTH instead of 1 needed entities2 = @group_handlauf_mitte1.entities ### MTH instead of 1 needed new_line = entities2.add_line rl1, rl2 length = new_line.length pf[mth] = [0, 0 - @run+@run*@il*(mth-1)+@run*@la*(mth-1)+@ro.abs, (mth-1)*@il*@rise+@sr] #mitte #point1 = Geom;;Point3d.new pf51 #constpoint = entities.add_cpoint point1 centerpoint = pf[mth] new_line = entities2.add_line rl1, rl2 vector = new_line.line[1] vector2 = vector.normalize! edges = entities2.add_circle centerpoint, vector2, @thradius kreis = entities2.add_face edges entity1 = entities[0] kurvem = entity1.all_connected status1 = kreis.followme kurvem end thanx for helping stan
  • Convert from .kml to .dae

    2
    0 Votes
    2 Posts
    2k Views
    Dan RathbunD
    The kmz is a zipped archive file. It has the dae file within it, inside the "models" folder.
  • RBZ update issue

    22
    0 Votes
    22 Posts
    799 Views
    jiminy-billy-bobJ
    Hmmm, right. Thanks
  • Material Take-Off by layers

    3
    0 Votes
    3 Posts
    339 Views
    pingpinkP
    Wow ! I changed the codes and it can analyze the layers. Thank you very very much , Dan !! selection.each { |s| is_group = s.is_a? Sketchup;;Group is_component = s.is_a? Sketchup;;ComponentInstance if s.layer.name == "Aluminium" ----continue---- }
  • Problem with component-definition in a loop

    2
    0 Votes
    2 Posts
    187 Views
    Dan RathbunD
    See the BBcode help page You need to use the [ code ] ... [/code ] bbCodes around your code example and it will look like this: [code:11ffgczd] Some example code; a = [1,2,3] last = a.pop puts last[/code:11ffgczd]
  • [Webdialog] freeze during Ruby operation

    9
    0 Votes
    9 Posts
    1k Views
    jolranJ
    Draw method, in a tool. Sorry, my misstake. Calculations for nodes are done outside the tool class. Passing through those methods I collect information to be sent to a container that the Tools draw method fetches information for rendering. I have a bit of work left there to get things organized. The data changes constantly so it will probably cost more to iterate what is needed to be updated then to redraw everything in 1 go. Since mostly dealing with Points and vectors, the new data will probably be totally different then the old anyway. I just clear the old data and bring in new, sort of, without going into details.. There are different types of data though. Persistent data that references to a Sketchup entity for ex, can be cached and updated only when switched. Anyway got a new situation now(TOPIC), have to redesign a lot on the Ruby side. I've studied your render cache. It's very nice and good example. Need to study it more though. Thanks for the input

Advertisement