Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes 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
  • How to detect changes in a model between two sessions

    3
    0 Szavazatok
    3 Hozzászólások
    610 Megtekintések
    R
    Thanks TIG. I like this solution. It should work in principle for the objects whose properties I am going to change. I think I have to change the way I store the objects though. Let me explain. The goal is to produce an insolation contour across the development (at ground level). To do this I do the following: 1 - mesh the surface that represents the interstitial space between buildings 2 - for each grid node I cast rays to cover the whole hemisphere 3 - for each ray I use raytest to verify whether I see the sky or I see an obstruction (this obstruction can be transparent or it can have an assigned temperature) Each Ray is an object with properties: direction, shaded_state, temperature, transparency and so on (there is no reference to Sketchup objects) Each grid node is represented by grid_node object with properties: coordinates and an array of Rays In order to implement your solution I think I will need to store the reference to the actual object that the Ray sees (if it does). I am not sure I can store a reference to a SketchUp object? Would the search in the datafile be faster than the re-calculation? I will test. Your proposed solution will not help though for the impact that a NEW object can have on specific grid nodes. My idea for this case was to replace the raytest with an intersection test between the new object (this is usually some form of local shading such trees, canopies, etc.) and the various rays for each grid node. I guess that the intersection test should be faster than raytest. Thanks again.
  • Loops

    15
    0 Szavazatok
    15 Hozzászólások
    1k Megtekintések
    A
    Problem solved!!! It's all about vectors. One of the arguments of the method that is resposable for creating the protrusions must be a vector or the order of the four given points of the rectangle must choosen in a way that the vector can be derived as the difference between the first two points of de rectangle. ` def findface(pt) arr = Sketchup.active_model.entities.grep(Sketchup::Face) arr.each {|f| return f if f.classify_point(pt) == Sketchup::Face::PointInside} return nil end def body ents = Sketchup.active_model.entities ents.clear! f = ents.add_face([0, 0, 0], [60, 0, 0], [60, 40, 0], [0, 40, 0]) f.pushpull(-30) end def protr(array, extrusion) ents = Sketchup.active_model.entities base = ents.add_face(array) arcvector = array[1].vector_to(array[0]) basenormal = base.normal depthvector = basenormal.cross(arcvector).reverse width = array[1].distance(array[0]) depth = array[2].distance(array[1]) basenormal.length = extrusion - width/2 basecenter = Geom::Point3d.new basecenter.x = (array[0].x + array[1].x)/2 basecenter.y = (array[0].y + array[1].y)/2 basecenter.z = (array[0].z + array[1].z)/2 center = basecenter + basenormal base.pushpull(extrusion + 1) ents.add_arc(center, arcvector, depthvector, width/2, 0, Math::PI) basenormal.length = extrusion + 0.5 findface(basecenter + basenormal).pushpull(-depth) ents.add_circle(center, depthvector, 1) findface(center).pushpull(-depth) end def test body protr [[22.0, 8.0, 30.0], [22.0, 20.0, 30.0], [10.0, 20.0, 30.0], [10.0, 8.0, 30.0]], 14.0 protr [[35.0, 8.0, 30.0], [47.0, 8.0, 30.0], [47.0, 20.0, 30.0], [35.0, 20.0, 30.0]], 14.0 end`
  • Need Help Compiling Gem for 32 bit Mac OS X

    14
    0 Szavazatok
    14 Hozzászólások
    2k Megtekintések
    A
    Oh wait, Fiddle::Importer is very similar to DL::Importable. I will migrate to Fiddle. Sorry for misleading you guys. Thanks for all the help
  • Probem Using UI:WebDialog and Javascript

    6
    0 Szavazatok
    6 Hozzászólások
    817 Megtekintések
    C
    Thanks very much, cleaning up html did the job. If its still of intereset, i use windows 7. Haven't seen my HTML mistake, so thanks again, curator
  • WebDialog input text and the single quote.

    5
    0 Szavazatok
    5 Hozzászólások
    678 Megtekintések
    sdmitchS
    @tt_su said: @sdmitch said: Early on I had problems using .get_element_value so I never thought about it again opting to get the values from the "p" string. What problem was that? I also utilize get_element_value for callbacks from JS to Ruby. I use a bridge that convert basic Ruby and JS objects back and forth with synchronous callback on both platform. Using an input element as data transfer is my standard technique. It was very early in my plugin career and involved radio buttons. As soon as I found something else that worked, I never tried using it again. I'm sure it was mostly, if not all, operator error.
  • Mad behaviour of String#hash

    6
    0 Szavazatok
    6 Hozzászólások
    721 Megtekintések
    Dan RathbunD
    @tt_su said: This .hash change affects only String, yes? The above Ruby bugs thread mentions Object#hash being overhauled (which is inherited by every object, unless overriden.) So a test under SketchUp 2014 & Ruby 2.0: (1) Open a SketchUp session, and in the console: Sketchup.hash %(#004000)[>> -112701995] This is the method that the Module class inherits from Object. (2) Close this SketchUp session, reopen SketchUp, and in the console: Sketchup.hash %(#004000)[>> -226388390]
  • How should i judge points can construct face or not

    7
    0 Szavazatok
    7 Hozzászólások
    701 Megtekintések
    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 Szavazatok
    8 Hozzászólások
    903 Megtekintések
    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 Szavazatok
    24 Hozzászólások
    7k Megtekintések
    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 Szavazatok
    3 Hozzászólások
    351 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    1k Megtekintések
    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 Szavazatok
    3 Hozzászólások
    426 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    440 Megtekintések
    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 Szavazatok
    2 Hozzászólások
    413 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    864 Megtekintések
    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 Szavazatok
    9 Hozzászólások
    692 Megtekintések
    mtripleM
    thx u all. that was useful ill replay since i do some changes.
  • SecureRandom slow

    10
    0 Szavazatok
    10 Hozzászólások
    991 Megtekintések
    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 Szavazatok
    5 Hozzászólások
    520 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    312 Megtekintések
    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 Szavazatok
    7 Hozzászólások
    680 Megtekintések
    G
    Thank you for checking it.

Advertisement