Esempio n. 1
0
        internal void AddValuePairs(List <DxfCodePair> pairs)
        {
            pairs.Add(new DxfCodePair(49, DashDotSpaceLength));
            pairs.Add(new DxfCodePair(74, (short)ComplexFlags));
            if (ComplexFlags != 0)
            {
                var value = IsEmbeddedElementAString ? 0 : ShapeNumber;
                pairs.Add(new DxfCodePair(75, (short)value));
                if (StylePointer.Handle.Value != 0)
                {
                    pairs.Add(new DxfCodePair(340, DxfCommonConverters.HandleString(StylePointer.Handle)));
                }
            }

            pairs.AddRange(ScaleValues.Select(s => new DxfCodePair(46, s)));
            if (IsEmbeddedElementAShape || IsEmbeddedElementAString)
            {
                pairs.Add(new DxfCodePair(50, RotationAngle));
            }

            foreach (var offset in Offsets)
            {
                pairs.Add(new DxfCodePair(44, offset.X));
                pairs.Add(new DxfCodePair(45, offset.Y));
            }

            if (IsEmbeddedElementAString)
            {
                pairs.Add(new DxfCodePair(9, TextString));
            }
        }
Esempio n. 2
0
        internal void TrySetPair(DxfCodePair pair)
        {
            switch (pair.Code)
            {
            case 2:
                Name = pair.StringValue;
                break;

            case 5:
                Handle = DxfCommonConverters.HandleString(pair.StringValue);
                break;

            case 330:
                OwnerHandle = DxfCommonConverters.HandleString(pair.StringValue);
                break;
            }
        }
Esempio n. 3
0
 private static void SetOwnerPair(IDxfCodePairOrGroup codePairOrGroup, IDxfItemInternal owner)
 {
     if (codePairOrGroup.IsCodePair)
     {
         var pair = (DxfCodePair)codePairOrGroup;
         if (pair.Code == 330)
         {
             pair.Value = DxfCommonConverters.HandleString(owner.Handle);
         }
     }
     else
     {
         foreach (var item in ((DxfCodePairGroup)codePairOrGroup).Items)
         {
             SetOwnerPair(item, owner);
         }
     }
 }
Esempio n. 4
0
        internal void AddCommonValuePairs(List <DxfCodePair> pairs, DxfAcadVersion version, bool outputHandles)
        {
            pairs.Add(new DxfCodePair(0, DxfTable.TableTypeToName(TableType)));
            if (outputHandles)
            {
                int code = TableType == DxfTableType.DimStyle ? 105 : 5;
                pairs.Add(new DxfCodePair(code, DxfCommonConverters.HandleString(Handle)));
            }

            foreach (var group in ExtensionDataGroups)
            {
                group.AddValuePairs(pairs, version, outputHandles);
            }

            if (version >= DxfAcadVersion.R2000)
            {
                pairs.Add(new DxfCodePair(330, DxfCommonConverters.HandleString(OwnerHandle)));
            }

            pairs.Add(new DxfCodePair(100, "AcDbSymbolTableRecord"));
        }
Esempio n. 5
0
 private static string HandleString(DxfHandle handle)
 {
     return(DxfCommonConverters.HandleString(handle));
 }
Esempio n. 6
0
 private static DxfHandle HandleString(string s)
 {
     return(DxfCommonConverters.HandleString(s));
 }
Esempio n. 7
0
 protected static string HandleString(DxfHandle handle)
 {
     return(DxfCommonConverters.HandleString(handle));
 }
Esempio n. 8
0
 protected static DxfHandle HandleString(string s)
 {
     return(DxfCommonConverters.HandleString(s));
 }