sketchucation logo sketchucation
    • Login
    1. Home
    2. James Fraser
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 42
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Useful formulas (that arent obvious)

      Maybe this is obvious, but helpful for those times when you can't see the wood for the trees. You could extend that to be the distance between two points by using (A!x - B!x) in place of x (same for y and z), where A and B are the two things in question.

      Obviously that would be the separation of the two axes rather than the gap between them, which would be complicated, except for special cases (like primitives).

      posted in Dynamic Components
      J
      James Fraser
    • Negative scaling/mirroring

      I was making some components today and the simplest way of doing something was to have a copy of a component mirrored. I thought I would just set lenx to a negative value and have that do it, the same as scale factor -1, but it did nothing.

      It seems that the len values are always made absolute. I know that I can simply physically copy the component this time and mirror it, but I am sure that there would be times when it would be handy to have mirrored objects created on the fly.

      If it is a design feature to enable people to put messy formulas in there and still get what they expect, I would prefer to make them use abs(). It could just be that the behind the scenes ruby stuff leads to this result, though.

      Maybe I have missed something, or is this just the way things are?

      It would also have been nice to just use =(-1^copy)*length, but I know ^ is on the todo list.

      posted in Dynamic Components sketchup
      J
      James Fraser
    • RE: Question about dynamic component

      That's excellent, glad I could help πŸ˜„

      posted in Dynamic Components
      J
      James Fraser
    • RE: Question about dynamic component

      Yes, it is looking a lot better now. If you want to specify things like that I think you will need to shift everything on the right 1.6cm to the left (ie the width of the side). This just means changing everywhere that you have -1.6 to -3.2 and changing the X for VK to =copy(parent!lenx -1.6)

      It is important to specify it like that, or the other side might move as well.

      And that should be it, I think πŸ˜„

      posted in Dynamic Components
      J
      James Fraser
    • RE: Question about dynamic component

      Would I be right in guessing that everything now stretches properly, but that the side jumps to the right by its own width? If so then you might want to check that the X for that side is equal to the total width minus its own width.

      If it is not something like that then if you post your model again I'll look at it for you and see what is going on.

      We'll get it working yet πŸ˜„

      posted in Dynamic Components
      J
      James Fraser
    • RE: Question about dynamic component

      I had a look at your model. You seem to be having the same problem as someone in this thread, although as you are taking positions for the side by adding the widths of the shelf and the other side the whole thing seems to jump back, not just leave a gap.

      I would have a look at my answer to that thread and the model I posted and try applying that to your model, it should be fairly straightforward. I can give you a longer explanation more specific to your model if you are still having trouble after that.

      posted in Dynamic Components
      J
      James Fraser
    • RE: Problem with Dynamic components ??

      Yep Chris, that is exactly what I did πŸ˜„

      I should have said that I saved it as a component really, sorry about that.

      It was a handy misunderstanding, though, as the fact that it worked fine just by being wrapped up shows how useful "parent!" is in attribute references; if I had used "frame!" instead then it would not have worked unless you called the wrapper "frame" as well.

      posted in Dynamic Components
      J
      James Fraser
    • RE: Problem with Dynamic components ??

      It is not a bug in SU. What is happening is that the length of your struts is scaling by the same amount as the whole frame, but that is not what you want, as part of the width is made up from the sides, which do not scale (remaining fixed at 4cm), so the top and bottom actually need to be slightly longer.

      I think the best way to do this is to have their length taken from the frame as a whole, similarly with their positions and for the sides.

      I rebuilt your frame to show you what I mean, take a look at the attributes for a guide as to what is going on. I think it should be clear enough when you look at it, but if you or anyone else wants an explanation then just ask.
      frame-fixed.skp

      I used a few other things in there, such as copies (good to keep the number of components down), restricting the scale tool and the parent! reference, which should show you how to use them, too, if you haven't come across them yet.

      I would add that it is best to avoid using groups as dynamic components, they don't have axes, so things could go wrong. Watch where your axes are, as well, they were in a strange place in your model, which could also mess things up.

      posted in Dynamic Components
      J
      James Fraser
    • RE: DC - 6Β² isn't written 6^2?

      @Matt you are correct, that will give you the right answer and it will work for only positive values.

      If b is negative and a is odd, then you can multiply by -1 to get the correct answer. If a is negative then you want 1/x at the end, instead of x.

      So a general formula might be:

      b^a = IF(SIGN(a)=1, IF((SIGN(b)=-1) AND (ISODD(a)), -1, 1)*EXP(a*LN(b)), 1/(IF((SIGN(b)=-1) AND (ISODD(a)), -1, 1)*EXP(a*LN(b)))
      

      Yeah, it would be nice if ^ worked.

      It is late here, so you may want to check that formula before relying on it.

      @Chris, there is no e in the example because e is a mathematical constant and the basis for exponentials (ie ^). It is the value where e^x = d/dx e^x and e^Ο€i=-1

      It's a very important number, but one you will only come across if you do a fair amount of calculus, probably. It makes sense that if you only have one exponential function available that it should be that one, but I would like ^ all the same.

      posted in Dynamic Components
      J
      James Fraser
    • RE: Dynamic component workflow

      I have tested things on XP and Vista and it is fine for me.

      I did have a think and I might have worked out what is going on for you. Would I be right in guessing that you create DCs, which work fine, then to save them you go to File => Save ? If you do this then your DC will not work. You have to go to the component browser and save from there.

      This is because when you access the Component Options you are only looking at the top layer component, in Component Attributes you see the top two layers. If your DC was saved within a model, when you import that model will be seen as a component containing the DC you were after.

      If you saved within a model more than once, or put your DC within another component, then you would see nothing in Component Attributes.

      You actually can alter the attributes of things beyond the first two layers, if you edit the component and select the Attributes from in there.

      I think that is probably what is going on, but if not then maybe you could post an example of the problem that we can take a look at.

      posted in Dynamic Components
      J
      James Fraser
    • RE: Dynamic component workflow

      I would treat DCs like Face Me components (I don't know if you have used them).

      When creating or editing you should have a model open and work on the DC within the model (not as a model in itself). When you are finished, go to In Model in the component browser, right click on your component and select "Save As" Save the model wherever you want. Saving like that for the first time has a tendency to mess things up a little (although less so than in 6), so you can open that model, reset the view and save again. You can also make some physical changes to the model when it is opened (rather than imported), but it is best to avoid doing DC things.

      To use the component later on, or make DC changes to it, you want to import it. I tend to do this using drag and drop from a file browser (nice and easy on my mac), but if you prefer using the component manager thing, then you want to go to the menu and select "Open a local collection...", then you can navigate to wherever you keep your components.

      Basically, the thing to remember with DCs is that you only see the functions when you view it as a component, not as a model.

      To be honest, I don't use the component window all that much (usually just to save), but I hope that helped answer your question. I have tested all of that with my own DCs and it worked fine.

      posted in Dynamic Components
      J
      James Fraser
    • RE: DC Exploration 1 - Color!

      Well, I will try to remember everything we wrote about the quotes and strings.

      Anything in quotes is treated as a string, so "RotZ" will simply return RotZ. This can be used when you want to affect a variable, for example

      ANIMATE("RotZ", 0, 90)
      

      which will animate RotZ through 0 to 90 degrees.

      Not putting something in quotes means it will be evaluated, eg:

      IF(RotZ=90, 1, 0)
      

      which will return 1 if the value of RotZ is 90 and 0 if it is not.

      & is used to concatenate strings, so

      "Rot" & "Z" = "RotZ"
      2 & 5 = 25
      

      There are many ways of getting from A to B, so if you are having trouble getting your component to animate the way you want, first check whether you should be using positive or negative degrees (270 and -90 are the same, apart from how you got there) and then try fixing values using =0 (or whatever the value should be). if you are trying to animate RotZ, then it may help to set RotX and RotY to =0, to make sure that only RotZ can change. Note that it is =0 and not just 0 (which will just set the value for now, not carve it in stone).

      To refer to an attribute in the same subcomponent you simply need its name, for example RotZ (noticing a theme emerging?). To refer to an attribute of another subcomponent you precede the attribute with the subcomponent name followed by an exclamation mark, eg gears!RotZ

      A special case of this is using parent!attribute which will refer to an attribute of the parent component.

      You can only refer to on the same or neighbouring levels, so you cannot refer from one component to the child of a child or vice versa. Like in Gears( gear( tooth))) having an attribute of tooth which refers to an attribute of Gears. You can get round this using custom attributes at each level to pass the message along (create a custom attribute of gear, in this case, which Gears and tooth will then both be able to reference).

      It is also good practice to custom attributes as an intermediary when doing something like ANIMATE, rather than referring to them directly.

      That's a start, at least. There was something else that caused a string to be evaluated, I think, but I can't remember what it is.

      posted in Dynamic Components
      J
      James Fraser
    • RE: My rubbish method of making a surface. Help please...

      I have to say that I missed the 'viola', but I did notice 'soften copular', which is probably funnier if you take the Spanish meaning of the second word.

      posted in SketchUp Discussions
      J
      James Fraser
    • RE: FILE SIZE ISSUES!!! PLEASE HELP!!

      As the problem seems to have been solved, I might be permitted to go slightly OT.

      Csaba, that model sounds really interesting, is it, or renderings of it, available anywhere? I saw your mausoleum model on Google Earth, but not much else (I don't know whether the other buildings are still there and in the same form and I am pretty sure there are less 14th century houses there now).

      posted in Newbie Forum
      J
      James Fraser
    • RE: Sketchup Artist Needed

      @unknownuser said:

      @unknownuser said:

      James Fraser wrote:Actually, most of the models on there are from FormFonts

      Oooh! I'll renew my subscription and apply then. πŸ’š

      If only I got commission for bringing in new subs

      posted in Corner Bar
      J
      James Fraser
    • RE: Sketchup Artist Needed

      Actually, most of the models on there are from FormFonts, so it looks like all you need to do is make the room itself and fill it with pre-made components. The OP can probably do that themselves, really. I wonder how many hours they were billed for.

      It was nice to see someone using my record player πŸ˜„

      It is playing Dark Side of the Moon, I may dig that out later.

      posted in Corner Bar
      J
      James Fraser
    • RE: Redneck Christmas Tree - Mt. Dew

      After drinking that much Mountain Dew how do you stop jittering enough to use the drill?

      posted in Corner Bar
      J
      James Fraser
    • RE: Google Earth Camera Car

      Is that Fort Kinnaird? I'll look forward to Edinburgh being on street view. I foresee spending some time going round spotting everything and trying to find people I recognise (assuming they aren't too blurred).

      posted in Corner Bar
      J
      James Fraser
    • RE: Dwg versions and output reports

      Ah, ok, this appears to be a Mac problem, I had assumed that the PC version would be the same, but you are correct. On the Mac you don't choose dwg (rather than 3ds, say), you choose the type of dwg. See below.

      Don't worry, I am not that much of a noob.

      That is a really annoying inconsistency, though.formats.png

      posted in Developers' Forum
      J
      James Fraser
    • Dwg versions and output reports

      Hi. I'm trying to write a little script to handle the various exports I have to do at the end of each model, but I'm having trouble with dwg. model.export picks up that it is a dwg fine, but SU lets you export a few kinds of dwg (or dxf) and I can't see a way to specify that. I think it is exporting acad 2004 and I would like acad 2000. I'm not having much luck finding out if there is a way to specify that, does anyone know of anything that might help?

      Also, when some formats are exported they bring up a messagebox with some statistics in, the numbers are useful, but not so much if they are just shown on the screen. It's a long shot, but does anyone know of a way to grab that information as a string or have it sent to a file, or something. Failing that I might just put a questionnaire at the end.

      Thanks

      posted in Developers' Forum
      J
      James Fraser
    • 1 / 1