Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66666

group placement

$
0
0

Hi,

 

I am experiencing a strange behavior. I place a group via code and the group gets rotated on its own. Also when manually pacing the group always a box comes shows up with the cursor prompting the user to place the group but when I prompt the user to place the group via "

Selection.PickPoint("Please pick a point.");

"

no box shows up with the cursor

 

UIDocument uidoc = uiapp.ActiveUIDocument;
                            FilteredElementCollector collector = new FilteredElementCollector(Command.doc).OfClass((typeof(GroupType)));
                            var groupTypes = from element in collector
                                             where element.Name == "test"
                                             select element;
                            Element groupType = groupTypes.First();
                            GroupType ty = (GroupType)groupType;

try
                                {
                            XYZ targetPoint = Command.uidoc.Selection.PickPoint("Please pick a point.");
                            using (Transaction trans = new Transaction(uidoc.Document))
                            {
                                
                                    trans.Start("sun");
                                   Group dt= uidoc.Document.Create.PlaceGroup(targetPoint, ty);
                                 
                                    trans.Commit();
                                
                               
                            }
                                }
                                catch (Exception ex)
                                {
                                   
                                    string ee = ex.ToString();
                                }

 

 

forrevitforum.png


Viewing all articles
Browse latest Browse all 66666

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>