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

    Posts

    Recent Best Controversial
    • Get rotation(transformation)

      Hi I was wondering if there is some simple method of getting the rotation of a group compared to world axis?
      Or do one have to make a complex comparison?

      In the picture, the edge is created from boundingbox.diagonal. Pt1 and pt3 and then grouped. It need to be a group for copying later on.
      I want the user to be able to determine the angle of the edge. Since the diagonal does change according to the boundingbox shape. I will need to reset the rotation and add user desired rotation.
      In this example I'm refering to the X-axis Or rotation around the Y-axis more precisely.
      Ultimately I would want this method for all axis, or rather like in the small picture. Sketchups views. It wont
      work with for ex 33.45 degrees angles, cause I cant determine PT for boundingbox.diagonal.
      Sketchup views would be sufficient in most cases.
      Any tips would be great.


      get_angle.jpg

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Copy _ group array(newbie)

      AAHH! Yes! Now it works.

      I spotted the . 25cm mistake. But did not think about the spaces.

      Thank you very much TIG and Jim!!

      I've learned a lot from this. Now I need to learn what has really happend in the code πŸ˜„

      And acctually I only needed 1 edge in the group. I did not know one could add the entities in an empty group.
      This is a lot better.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Copy _ group array(newbie)

      It's not working for me properly 😳 I get nil..
      Probably did not understand you fully. Does the declaration on first 3 lines cause a conflict somehow?
      I'm using Alex ruby code editor.

      I like the idea of using vector though and avoiding bugsplats πŸ˜„

      mod = Sketchup.active_model # Open model
      ent = mod.entities # All entities in model
      sel = mod.selection # Current selection
      
      group = model.active_entities.add_group() ###==new empty group
      group.entities.add_line ([0,0,0],[25.cm,0,0])  
      group.entities.add_line ([25.cm,0,0],[30.cm,0,0])
      
      ### assume we gave the 'group' already placed at [0,0,0]
      vector=Geom;;Vector.new(0,10.cm, 0)
      gp=group
      groups=[gp]
      5.times{|i|
        tgp=gp.copy
        tgp.transform!(Geom;;Transformation.translation(vector))
        gp=tgp
        groups << gp
      }
      ### we now have the 5 copies at 10cm in X...
      ### and a 6 element array containing references to all groups
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Copy _ group array(newbie)

      Tig, I will try what you say. Your version is a little harder to understand, but I need to get it to work I think for my next step that has to do with group.boundingbox and positions etc.

      @unknownuser said:

      Bugsplats are common making a group from entities

      Yes, I imagine that. I got a little carried away when something actually does work.
      And the plugin I'm trying to do (I'm in over my head) will need a lot of copies.

      I'm sorry about the dimension thing. 10 cm was not important. Just an example. I needed the concept to work
      regardless of the dimensions. The submitted code actually copies in Y direction now

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Copy _ group array(newbie)

      Working code is at top. What it does?

      Makes 2 edges and group them.
      Copies the group 10 times 25 units apart in Y axis.

      Thanks Jim and Tig.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Copy _ group array(newbie)

      Its very nice I got 2 different versions of the method. Helps me understand. I think I get the logic in the methods, but I havent configured my group correctly to adapt to your code's. I get = nil.

      h_line1 = ent.add_line [0,0,0], [250,0,0]
      h_line2 = ent.add_line [250,0,0], [255,0,0]
      line_group1 = ent.add_group(h_line1, h_line2)
      

      Is my group. Do the center of the new group have to be on [0,0,0] ?

      so for JIM's code I added:

      tr = Geom;;Transformation.translation [25,0,0]
      group_copy = your_group.copy
      

      There is no need to call for ent.transform_entities tr, ?

      In TIG's code I just added: gp=line_group1

      Thanks a lot Guys! Im happy, at least I now have something to go on.

      posted in Developers' Forum
      jolranJ
      jolran
    • Copy _ group array(newbie)

      Hello.

      Can someone please give me a hint how I can copy groups in an array, similar or same as in Sketchup manual modeling.
      Im stuck... And need to move on to next step in problemsolving.

      Can't find more information than just group.copy single object in the API and similar threads in here.

      How does one go about? Must be trivial for most people in here. Ive tried som "each do" iterator, stuff and * operators but no GO..

      Logically I suspect 1 edge cannot form a group? So I have 2 edges connected together. I havent found any copy methods
      for edges or entities(thats why I've grouped the edges).

      So for ex. Lets say there are 2 edges that are grouped, called = line_group at [0,0,0]

      Just like in Sketchup modeling, I want to copy line_group with 5 multiple copies 10 units(cm in my case) in X axis.

      BTW. The result of the array will be grouped and used with intersect_with method later on so I guess they wont have to be unique?

      mod = Sketchup.active_model # Open model
      ent = mod.entities # All entities in model
      sel = mod.selection # Current selection
      
      h_line1 = ent.add_line [0,0,0], [10,0,0]
      h_line2 = ent.add_line [10,0,0], [12,0,0]
      line_group1 = ent.add_group(h_line1, h_line2)
      
      tr = Geom;;Transformation.translation([0,25,0])
      group_copy = line_group1.copy
      number_of_copies = 10
      
      number_of_copies.times do
      # Move
      group_copy.transform!(tr)
      # next
      group_copy = group_copy.copy
      end
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Entering groups.Again...

      @unknownuser said:

      Of course you can use any API tools within ANY entities context.

      Thats even better.

      I learned a lot from this, thanks all!

      Have to analyze this info and make me understand it fully. Local and Global coordinate system can be a little daunting to dig into for a newbie, but you explained it very well.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Entering groups.Again...

      You guys are great! πŸ‘

      This is more logical. Opens up more possibilities compared to what I thought was doable in Ruby.
      No wonder I did not understand how some plugins was constructed if I thought one could not alter geometry in groups/comp.. Need to get back to basics..Not ready to fool around yet.

      So if I got this right. On top of adding/del. geometry, one can alter it as well(transl., scaling etc)?

      @unknownuser said:

      Group's context active

      If group is not open in modelspace or in Rubycode, one cannot use tools on geometry, pushpull for ex?
      Have to get a grasp of the term "context active". (Note to myself)

      Thank you all for your help. And mr TIG's detailed explanation. I have to reread that one a couple of times to get it into my thick skull.

      posted in Developers' Forum
      jolranJ
      jolran
    • Entering groups.Again...

      Hello. I know this topics been answered before in a similar fascion,
      but I'm a little confused about the subject.

      I was under the strict impression that groups could not be entered no matter what, through Ruby code.

      However after reading through "Automatic Sketchup" I went back to page and 148 it said(a portion of it):

      @unknownuser said:

      Each Group stores its Entity objects in its own separate Entities container, and you can access this by invoking the Group's entities method. With this collection, you can add Edges, Faces, and other Entity objects to the Group as though it was the top-level SketchUp model. For example, the following code adds a circular array of Edges to group1:
      ent_g = group1.entities
      circle = ent_g.add_circle [0.5, 0.5, 1], [0, 0, 1], 0.25

      So what does this mean? One CAN enter the group and add geometry after the groups been created?
      And this would apply to components as well?
      Or am I missunderstanding some fundamential rule in the example.

      English is not my native language so, I might have gotten it all wrong..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Does anyone use UML?

      @unknownuser said:

      Also, I made a (imperfect) API diagram some time ago

      Very nice! Will print them as reference.
      Also the API object diagram did I miss.

      Good things!

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Does anyone use UML?

      Isent that a method to structure and organize your code
      before even have written the code, for a better workflow?

      It is probably more common for larger project, not sure.
      Im reading up on Ruby and there where some info on it in a book.
      And considering the book was about Ruby, there must be use of UML in Ruby.

      BTW, if you're still at beginnerstage? I might recommend Lynda.com training for Ruby.
      It costs 25$ a month but there are tutorials about HTML and JAVAscript tuts(for webdialogs) there as well.
      I've gone through the videos and learned a lot about the basics in Ruby. Good sections about setting attribute
      and classes.

      edited: I see in other post your not "that kind" of newbie 😳

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Does anyone use UML?

      Nice link. A lot of reading.
      So is it only to visualize "code flow"? Or can one generate code through nodes by modeling them?
      My guess is not.
      It look fancy though..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: WYSIWYG for webdialogs.

      Thanks πŸ˜„

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: WYSIWYG for webdialogs.

      Thanks ThomThom!

      HTML dog indeed had some good libraries and tutorials.

      I can see this "Ruby" side of Sketchup can fast become an addiction. A shame I havent started earlier.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: WYSIWYG for webdialogs.

      I suspected some of you experts did not use WYSIWYG editor or did not trust them fully.

      And get enough knowledge about the languages to know where to look,
      even if using an editor, is an advice I will follow.

      @unknownuser said:

      I'm slowing building a library that let you build the WebDialog UI via Ruby.

      That sound very interresting, and probably is a lot of work!
      The inbuilt UI-menu for sketchup seams to be very limited indeed, so
      this would be very welcomed.

      The more I read up on things the more I realise there isent so many shortcuts
      for knowledge.
      But Ill give it a try. Its fun.

      Thanks

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: WYSIWYG for webdialogs.

      @unknownuser said:

      I wouldn't buy a wysisyg editor just for WebDialogs, [there are lots of open source ones out there

      Webbuild.7 is only 45 $. Affordable if I get "usable" results, wich acctually was the main question. Ive tried some other WYSIWYG editors and liked this
      one the best cause of simplicity.

      I am going to have a look at working with ruby code editor and HTML files.
      Very good advice there, thanks! πŸ‘
      I'm using it already but did not think of using it in that way.
      Had some crashes in SU. Still using ver 7.1. But thats another topic...

      I have gone through Martins R's tutorials. Funny guy. Very good tutorials though. I will go through them again when I have finished reading "Javascript in 24 hours" πŸ˜„

      Thanks for the respond.

      posted in Developers' Forum
      jolranJ
      jolran
    • WYSIWYG for webdialogs.

      Hi. Im new here so hello to everyone!

      I have been trying to learn ruby last couple of weeks, and is on the "newbie level" of making an icon and call
      for webdialog OK in SU.
      It is kind of daunting to try to learn 3 languages(Ruby, HTML and Jsript) just to make a dialog.

      My question is: Is anyone using WYSIWYG editors for plunking out html code?

      It seems an easier approach to lay out the dialog visually. I realise one have to learn html somewhat but was thinking of shortcutting it a just littl,e and focus more on learning Javascript for callbacks to SU.

      Have been trying Webbuilder 7. http://www.wysiwygwebbuilder.com/download.html

      But a little consearned about the code generated. Its gives nice results visually and fast.
      I cant really say if I'm waisting my time on this one, and that it will not work when
      I am going to communicate with my dialog to SU.

      Any advice would be nice.

      Thanks.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: PhotoSculpt

      That make pefect sence. Its like "Cameramapping" in XSI.

      Sounds great!

      And for all people who doesent have PRO version(majority) import of obj might be problematic.
      One can use Ultimate Unwrap3d or Okino. The mentioned first is cheaper and has UV editing, good companion to Photo sculpt
      maybe πŸ˜›

      posted in Extensions & Applications Discussions
      jolranJ
      jolran
    • RE: Bonzai 2.0 released

      @unknownuser said:

      I've d/l Bonzai 2 and played around with it. I tried to import a .skp but no luck I am afraid. It says 'SketchUp file created in unsupported version'.

      Hmm. SKP is a mystical format..
      So I suppose Bonzai to SU is ehhh, problematic?

      posted in Extensions & Applications Discussions
      jolranJ
      jolran
    • 1
    • 2
    • 48
    • 49
    • 50
    • 51
    • 52
    • 50 / 52