PDA

View Full Version : Simply selecting a family member



r.howarth
2008-01-16, 11:41 PM
I am trying to make it easier for our drafters to select detail components etc, in cad they had macros they typed rather than click around, so I'm trying to emulate that to an extent in revit.

I have looked at the examples on how to load family members and all that, but how do you actually just select them in so the user can place them on their model? I.e exactly the same as selecting them from the list.

This is probably a simple question, but I'm struggling to find this, once I've exhausted the API samples and the API presentation I've got nothing but intellisense.... If anyone knows of anymore resources in Australia to learn the API I'd greatly appreciate it, I'm starting to get some things downpat, but my main struggle is knowing if things are actually possible or if I'm just floundering around aimlessly.

GuyR
2008-01-17, 01:00 AM
I have looked at the examples on how to load family members and all that, but how do you actually just select them in so the user can place them on their model? I.e exactly the same as selecting them from the list.
Assuming the family exists in the project you use Document.NewFamilyInstance and one of the overload options for specifying where in space you want to place the family instance.


If anyone knows of anymore resources in Australia to learn the API I'd greatly appreciate it
Do you mean .NET or Revit API? .NET courses will run everywhere. ADN runs some webcast training sessions every year , you register here (http://usa.autodesk.com/adsk/servlet/item?id=6703509&siteID=123112&cname=Revit%20API,%20Webcast,%20May%2006%202008,%201320) . Also check out some of the AU material and webcasts.


but my main struggle is knowing if things are actually possible or if I'm just floundering around aimlessly.
Like all of us it's practice. The more your write the more you'll learn.

HTH,

Guy

r.howarth
2008-01-17, 04:55 AM
Assuming the family exists in the project you use Document.NewFamilyInstance and one of the overload options for specifying where in space you want to place the family instance.

I realise you can insert it to a pre-defined position, but how do I just make it so that its on the users cursor so they can click where they want it to go? Is there an option for that? I can't seem to find it.

Or perhaps there is a way to set an XYZ variable based on a users click? So I can have the user run my tool, then click where they want, and the tool inserts a certain family type there.

As you can tell I'm not really trying to do anything big or new, just trying to shorten the way our drafters do things.



Do you mean .NET or Revit API? .NET courses will run everywhere. ADN runs some webcast training sessions every year , you register here (http://usa.autodesk.com/adsk/servlet/item?id=6703509&siteID=123112&cname=Revit%20API,%20Webcast,%20May%2006%202008,%201320) . Also check out some of the AU material and webcasts.

Like all of us it's practice. The more your write the more you'll learn.

HTH,

Guy

Revit API, I'm registered to the web cast but I assume it wouldnt be much different to last years which I think I have a video of. You're right though, I guess it's just practice.

mmason.65315
2008-01-17, 03:35 PM
Rod,

Sorry there's currently no API where you can pick an X,Y location on the screen to place something...

The only selection method returns back an element, which you can usually get a location from. I've been meaning to try this as a (bad) method of placement - where they could then move the instance afterwards... It seems better than dropping it at an arbitrary 0,0 point.

As a side note, if you loaded the family programmatically, that family is the default when you go into component placement. (I did another app which just loaded the family - but the user had to go place it).

-Matt
http://cadappdev.blogspot.com