Found a page that shows how to do this: http://code.google.com/apis/sketchup/docs/tutorial_attrreporting.html
Posts
-
RE: Custom Attributes
-
RE: Custom Attributes
I've modified my code trying to use what Jim suggested:
model=Sketchup.active_model entities = model.entities entities.each { |yo| UI.messagebox(yo.get_attribute "dynamic_attibutes", "PN" ) }
I get a blank UI message to hit OK and then it's done. I was expecting to get a lot of UI messages since there will be many entities in the model. Having one blank message is odd.
-
RE: Custom Attributes
I can generate a report just fine.
I'm looking to make a custom script that only looks at the items that have that custom attribute typed in, then reads in a list of prices for each part number from another csv file and calculates price based on that.
First step is to identify all objects that have the custom attribute. Not having much luck yet.
-
Custom Attributes
Not sure what I'm missing here. I have a model where I've used the regular GUI "Component Attributes" tool to add a custom attribute to a component (a part number). I've done that to many components and now want to print out the list of all part numbers in the model. The attribute name is "PN"
I thought this would do it:
require 'sketchup' model=Sketchup.active_model entities = model.entities entities.each { |yo| UI.messagebox(yo.get_attribute "PN" ) }
I get error messages referring to libraries. I see from the documentation that the get_attribute method requires a dict_name and a key but I don't know what those are, I only know "PN".
Can anyone shed some light?
-
RE: Crazy Rotating Objects
How'd you do that?
How did you stop it from going crazy? Did you see what I was doing wrong in my model?
-
RE: Crazy Rotating Objects
One other thing I just though of to try after I posted my last message.
I just did everything as listed on my previous post but on step 4, I didn't make the door frame have a cutting plane.
Now the door swings open as expected.
So, it appears that having a cutting plane and also having dynamic movement are mutually exclusive except I can see that google pulled it off in their sketchup dynamic components examples file.
-
RE: Crazy Rotating Objects
Well, it seems to be the fact that the door assembly is capable of cutting the wall that messes it up.
Here's something I just tried:
- I exploded all the geometry (no more components or groups)
- I turned the part that should move into a component making sure its axis was on the edge I wanted it to pivot on.
- I then added RotZ and tried modifying the RotZ value. The door swung open as it should.
- I turned the door frame back into its own component with a cutting plane.
- I made sure the cutting plane worked by dragging a copy of the door frame over and sure enough it cut a hole in the wall so that works.
- Finally, I cut the swinging door component with its RotZ variable and pasted in place inside the cutting component frame.
- Now when I modify the RotZ of the swinging door, it goes haywire again.
Perhaps it's not possible to create a door that can open and shut dynamically and still cut into a wall like a window can?
-
Crazy Rotating Objects
I'm having trouble making a dynamic door that can cut through walls when placed. The cutting part works fine. The door opening part is not.
I'm just trying to make it dynamic so it can rotate on its hinge when I click on it. The first step is to add the rotation variables for the swinging door which I've done. To test it, I change the value of RotZ (the blue axis of the swinging door is the hinge) and the door goes crazy. I have no idea why. I try changing the other rotation variables instead and it's still crazy.
I've rebuilt this thing several times and always the same.
Can anyone see what I'm doing wrong? File is here:door.skp