Wishlist rs.DimensionPosition


#1

Greetings,
It would be great if functions could be added to the rhinoscriptsyntax library to return the location current of dimensions. I have put together an example of this using rhino common.

def AlignedDimension_Points(self,dim):
        """
        Get the end points for the extension lines,
        text position and arrow heads.
        Identify the type of dimension being used
        Get User Text for dimension
        
        Input Parameters:
            dim = guid for an aligned dimension
        
        Return:
            Type - Identify the type of demension
            AH1 - 3D [point] identifying the end of arrow head 1
            AH2 - 3D [point] identifying the end of arrow head 2
            EL1 - 3D [point] identifying the end of extension line 1
            EL2 - 3D [point] identifying the end of extension line 2
            TP - 3D [point] identifying the center for text position
        """
        if rs.IsAlignedDimension(dim)==True:
            Type="AlignedDimension"
            
            Dim=rs.coercegeometry(dim)
            Plane=Dim.Plane
            Text=Dim.Text
            
            AH1=Plane.PointAt(Dim.Arrowhead1End[0],Dim.Arrowhead1End[1])
            AH2=Plane.PointAt(Dim.Arrowhead2End[0],Dim.Arrowhead2End[1])
            EL1=Plane.PointAt(Dim.ExtensionLine1End[0],Dim.ExtensionLine1End[1])
            EL2=Plane.PointAt(Dim.ExtensionLine2End[0],Dim.ExtensionLine2End[1])
            TP=Plane.PointAt(Dim.TextPosition[0],Dim.TextPosition[1])
            
            Dimension=[Type,AH1,AH2,EL1,EL2,TP,Text]
            return Dimension
        return None

This works for linear dimensions and aligned dimensions, however I am currently unable to return information for the location of angular dimensions using python.

Thanks,
5chmidt


(Steve Baer) #2

Thanks, I added this to our issue tracker wishlist.
http://mcneel.myjetbrains.com/youtrack/issue/RH-27458