Beispiel #1
0
        /// <summary>
        /// Adds a curve annotation handle to the dictionary.
        /// </summary>
        /// <param name="sketchPlaneId">
        /// The sketch plane id.
        /// </param>
        /// <param name="curveStyleHandle">
        /// The curve style handle.
        /// </param>
        /// <param name="curveAnnotation">
        /// The curve annotation handle.
        /// </param>
        public void AddAnnotation(ElementId sketchPlaneId, IFCAnyHandle curveStyleHandle, IFCAnyHandle curveAnnotation)
        {
            CurveAnnotationKey curveAnnotationKey = new CurveAnnotationKey();

            curveAnnotationKey.SketchPlaneId    = sketchPlaneId;
            curveAnnotationKey.CurveStyleHandle = curveStyleHandle;

            if (annotationMap.ContainsKey(curveAnnotationKey))
            {
                throw new Exception("CurveAnnotationCache already contains this curveAnnotationKey");
            }

            annotationMap[curveAnnotationKey] = curveAnnotation;
        }
 /// <summary>
 /// Gets the curve annotation handle from the dictionary.
 /// </summary>
 /// <param name="sketchPlaneId">
 /// The sketch plane id.
 /// </param>
 /// <param name="curveStyleHandle">
 /// The curve style handle.
 /// </param>
 /// <returns>
 /// The curve annotation handle.
 /// </returns>
 public IFCAnyHandle GetAnnotation(ElementId sketchPlaneId, IFCAnyHandle curveStyleHandle)
 {
     IFCAnyHandle curveAnnotationHandle;
     CurveAnnotationKey curveAnnotationKey = new CurveAnnotationKey();
     curveAnnotationKey.SketchPlaneId = sketchPlaneId;
     curveAnnotationKey.CurveStyleHandle = curveStyleHandle;
     if (annotationMap.TryGetValue(curveAnnotationKey, out curveAnnotationHandle))
     {
         return curveAnnotationHandle;
     }
     else
     {
         return null;
     }
 }
Beispiel #3
0
        /// <summary>
        /// Gets the curve annotation handle from the dictionary.
        /// </summary>
        /// <param name="sketchPlaneId">
        /// The sketch plane id.
        /// </param>
        /// <param name="curveStyleHandle">
        /// The curve style handle.
        /// </param>
        /// <returns>
        /// The curve annotation handle.
        /// </returns>
        public IFCAnyHandle GetAnnotation(ElementId sketchPlaneId, IFCAnyHandle curveStyleHandle)
        {
            IFCAnyHandle       curveAnnotationHandle;
            CurveAnnotationKey curveAnnotationKey = new CurveAnnotationKey();

            curveAnnotationKey.SketchPlaneId    = sketchPlaneId;
            curveAnnotationKey.CurveStyleHandle = curveStyleHandle;
            if (annotationMap.TryGetValue(curveAnnotationKey, out curveAnnotationHandle))
            {
                return(curveAnnotationHandle);
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// Adds a curve annotation handle to the dictionary.
        /// </summary>
        /// <param name="sketchPlaneId">
        /// The sketch plane id.
        /// </param>
        /// <param name="curveStyleHandle">
        /// The curve style handle.
        /// </param>
        /// <param name="curveAnnotation">
        /// The curve annotation handle.
        /// </param>
        public void AddAnnotation(ElementId sketchPlaneId, IFCAnyHandle curveStyleHandle, IFCAnyHandle curveAnnotation)
        {
            CurveAnnotationKey curveAnnotationKey = new CurveAnnotationKey();
            curveAnnotationKey.SketchPlaneId = sketchPlaneId;
            curveAnnotationKey.CurveStyleHandle = curveStyleHandle;

            if (annotationMap.ContainsKey(curveAnnotationKey))
            {
                throw new Exception("CurveAnnotationCache already contains this curveAnnotationKey");
            }

            annotationMap[curveAnnotationKey] = curveAnnotation;
        }