Inserting single family instance

Inserting single family instance

devX6MRR
Contributor Contributor
811 Views
5 Replies
Message 1 of 6

Inserting single family instance

devX6MRR
Contributor
Contributor

Hi to everyone,

i'm trying to implement the insertion of a family instance from an external library.

When I fire the event to proceed with insertion, I use "PromptForFamilyInstancePlacement" command; this command starts inserting elements till you press "Esc" key.

 

My aim limitate the insertion operation to a fixed number of instance.

 

Is there a way to implement this kind of process using "PromptForFamilyInstancePlacement" or any other way without using this command?

 

Thanks,

Giorgio

0 Likes
Accepted solutions (1)
812 Views
5 Replies
Replies (5)
Message 2 of 6

matthew_taylor
Advisor
Advisor
Accepted solution

Hi @devX6MRR,

Check out this sample from theBuildingCoder:

https://github.com/jeremytammik/the_building_coder_samples/blob/706115e03fdac2c586ba0537061cd5dd1ac4...


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 3 of 6

devX6MRR
Contributor
Contributor

Hi @matthew_taylor,

I just read your answer and I read the snippet you linked: 

the sample is the one we used to start the family insertion.

 

The problem is that once started insertion till "Esc" pression i can continue insert selected family.

The behaviour is this: i start inserting element -> after first element i escape from insertion procedure.

 

Maybe in this way is a little more clear my main aim.

 

Giorgio

0 Likes
Message 4 of 6

matthew_taylor
Advisor
Advisor

Hi @devX6MRR,

That is exactly what the sample does. Look at the _place_one_single_instance_then_abort object. If set to true, it should stop after one placement. Check out line 117 onwards.


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 5 of 6

devX6MRR
Contributor
Contributor

Hi @matthew_taylor

I checked better the snippet and the only thing i can say is "oh, i didn't notice".

As soon as possible I'll try and I'll let you know.

 

Thanks a lot,

Giorgio

0 Likes
Message 6 of 6

devX6MRR
Contributor
Contributor

Thank you, it fitted very well my problem, I had a little trouble to find missing parts (about Press class and Window Handle), but i found them.

Now it works perfectly.

 

Thank you again

Giorgio