Create Columns from Imported CAD

Create Columns from Imported CAD

hossam.amer666
Enthusiast Enthusiast
1,188 Views
9 Replies
Message 1 of 10

Create Columns from Imported CAD

hossam.amer666
Enthusiast
Enthusiast

Hello guys, 

I'm trying to make an adding that could automatically create columns from imported cad file so my plan is to filter the elements from imported cad by layer name and I managed to get a list of GeometryObject which I cast to a list of polyLines then I got also the center point of each polyLine. 

Now my question is,

Using doc.Create.NewFamilyInstance(Location, symbol, level, structural type) function, How can I use the list of polylines I have to create FamilySymbols by the dimensions of unique values of polylines and pass it to to the function? 

Another question, Do I need to use foreach loop to send the list of points I have point by point or there is another way ?

0 Likes
Accepted solutions (1)
1,189 Views
9 Replies
Replies (9)
Message 2 of 10

jeremy_tammik
Alumni
Alumni

For placing family instances, please look at the PlaceInstances add-in:

 

 

Please note that NewFamilyInstance has many overloads, and you need to use the appropriate one depending on the family you are placing:

 

 

Looping over the points one by one is normally fine for placing instances.

 

Just ensure you use one single transaction, and not a separate transaction for each instance.

 

 

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 10

hossam.amer666
Enthusiast
Enthusiast

It's a great honour to get a reply from you, sir. I check your blogs but I can't figure out how to use my list of polyLines to create family symbols of a rectangle column with the dimensions of polylines. 

0 Likes
Message 4 of 10

Moustafa_K
Collaborator
Collaborator

not sure if this saves some steps for you. If you already know it is a rectangle Column, then all you need is only the Width, Height, and Location, and plug these parameters into a predefined Rectangle Family file/instance. (just check if the parameters you will add value to are Type/Instance parameters. 

 

hope this helps

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
Message 5 of 10

hossam.amer666
Enthusiast
Enthusiast

Ok now I managed to create column types by extracting the unique values of width and height and put these types in a list of familySymbols and I already have a list of XYZ represents the center points of columns and also I have to lists of doubles one for widths and another one for heights .. How can I use this Information to place columns?

0 Likes
Message 6 of 10

jeremy_tammik
Alumni
Alumni

Simply by reading the answers already provided above, my friend.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 7 of 10

hossam.amer666
Enthusiast
Enthusiast

ColumnsRotation.PNG

I managed to place them but as you see I have a problem with the rotation to how can I fix it?

0 Likes
Message 8 of 10

jeremy_tammik
Alumni
Alumni
Accepted solution

Search this forum for 'rotate family instance'.

 

Please always search for answers before raising them anew.

 

That is the purpose of this forum and saves time and effort for you yourself and others.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 9 of 10

hossam.amer666
Enthusiast
Enthusiast

Of course, I have searched and tried alot before asking however thank you I will try to figure it out myself. 

0 Likes