@@ -9934,6 +9934,33 @@ DWG_ENTITY_END
9934
9934
FIELD_B (dimension .flip_arrow2 , 296 ); \
9935
9935
FIELD_B (dimension .flip_arrow1 , 297 )
9936
9936
9937
+ #define AcDbOsnapPointRef_fields (index ) \
9938
+ LOG_HANDLE ("DIMASSOC_Ref .rcount1 : %d \n ", index ); \
9939
+ SUB_FIELD_T (ref [index ], classname , 1 ); /* "AcDbOsnapPointRef" */ \
9940
+ SUB_FIELD_RC (ref [index ], osnap_type , 72 ); /* 0-13 */ \
9941
+ SUB_FIELD_BL (ref [index ], num_xrefs , 0 ); \
9942
+ SUB_HANDLE_VECTOR (ref [index ], xrefs , num_xrefs , 4 , 331 ) ; \
9943
+ if (FIELD_VALUE (ref [index ].osnap_type ) != 0 ) \
9944
+ { \
9945
+ SUB_FIELD_BL (ref [index ], main_subent_type , 73 ); \
9946
+ SUB_FIELD_BL (ref [index ], main_gsmarker , 91 ); \
9947
+ SUB_FIELD_BL (ref [index ], num_xrefpaths , 0 ); \
9948
+ FIELD_VECTOR_T (ref [index ].xrefpaths , T , ref [4 ].num_xrefpaths , 301 ) \
9949
+ } \
9950
+ SUB_FIELD_BD (ref [index ], osnap_dist , 40 ); \
9951
+ SUB_FIELD_3BD (ref [index ], osnap_pt , 10 ); \
9952
+ if (FIELD_VALUE (ref [index ].osnap_type ) == 6 \
9953
+ || FIELD_VALUE (ref [index ].osnap_type ) == 11 ) \
9954
+ { \
9955
+ SUB_FIELD_BL (ref [index ], num_intsectobj , 0 ); \
9956
+ SUB_HANDLE_VECTOR (ref [index ], intsectobj , num_intsectobj , 5 , 332 ); \
9957
+ SUB_FIELD_BL (ref [index ], intersec_subent_type , 74 ); \
9958
+ SUB_FIELD_BL (ref [index ], intersec_gsmarker , 92 ); \
9959
+ SUB_FIELD_BL (ref [index ], num_intersec_xrefpaths , 0 ); \
9960
+ FIELD_VECTOR_T (ref [index ].intersec_xrefpaths , T , ref [index ].num_intersec_xrefpaths , 302 ) \
9961
+ } \
9962
+ SUB_FIELD_B (ref [index ], has_lastpt_ref , 75 );
9963
+
9937
9964
// (varies) UNSTABLE
9938
9965
// 1-4 references, see associativity bits 1-8.
9939
9966
DWG_OBJECT (DIMASSOC )
@@ -9944,48 +9971,30 @@ DWG_OBJECT (DIMASSOC)
9944
9971
FIELD_B (trans_space_flag , 70 );
9945
9972
FIELD_RC (rotated_type , 71 );
9946
9973
FIELD_HANDLE (dimensionobj , 4 , 330 );
9947
- REPEAT_CN (4 , ref , Dwg_DIMASSOC_Ref ) // i.e. AcDbOsnapPointRef
9974
+ REPEAT_CN (6 , ref , Dwg_DIMASSOC_Ref ) // i.e. AcDbOsnapPointRef
9948
9975
REPEAT_BLOCK
9949
- // TODO: there could be much more blocks, up to 5.
9950
- // 0 1 2 3 => 1 2 4 8. skip unset bits
9951
- if (!(FIELD_VALUE (associativity ) & (1 <<rcount1 )))
9976
+ // index 0 1 2 3 => bits 1 2 4 8. skip unset bits
9977
+ if (!(FIELD_VALUE (associativity ) & (1 << rcount1 )))
9952
9978
{
9953
9979
#ifdef IS_JSON
9954
9980
ENDHASH ;
9955
9981
#endif
9956
9982
continue ;
9957
9983
}
9958
- LOG_HANDLE ("DIMASSOC_Ref .rcount1 : %d \n ", rcount1 );
9959
- // DXF: 1, 72, 10, ??, 75
9960
- SUB_FIELD_T (ref [rcount1 ], classname , 1 ); // "AcDbOsnapPointRef"
9961
- SUB_FIELD_RC (ref [rcount1 ], osnap_type , 72 ); // 0-13
9962
- // idpaths:
9963
- SUB_FIELD_BL0 (ref [rcount1 ], num_intsectobj , 74 );
9964
- SUB_HANDLE_VECTOR (ref [rcount1 ], intsectobj , num_intsectobj , 5 , 332 );
9965
-
9966
- SUB_FIELD_BD (ref [rcount1 ], osnap_dist , 40 );
9967
- SUB_FIELD_3BD (ref [rcount1 ], osnap_pt , 10 );
9968
-
9969
- // XrefFullSubentPath
9970
- SUB_FIELD_BL (ref [rcount1 ], num_xrefs , 0 ); // 1 or 2
9971
- SUB_VALUEOUTOFBOUNDS (ref [rcount1 ], num_xrefs , 100 )
9972
- SUB_HANDLE_VECTOR (ref [rcount1 ], xrefs , num_xrefs , 4 , 331 );
9973
-
9974
- // restrict only when writing, not when reading?
9975
- //if (FIELD_VALUE (ref[rcount1].osnap_type) == 6 || FIELD_VALUE (ref[rcount1].osnap_type) == 11)
9976
- // {
9977
- SUB_FIELD_BL0 (ref [rcount1 ], main_subent_type , 73 );
9978
- SUB_FIELD_BL (ref [rcount1 ], main_gsmarker , 91 );
9979
- SUB_FIELD_BL (ref [rcount1 ], num_xrefpaths , 0 );
9980
- FIELD_VECTOR_T (ref [rcount1 ].xrefpaths , T , ref [rcount1 ].num_xrefpaths , 301 )
9981
- // }
9982
- SUB_FIELD_B (ref [rcount1 ], has_lastpt_ref , 75 );
9983
- if (FIELD_VALUE (ref [rcount1 ].has_lastpt_ref ))
9984
- {
9985
- SUB_FIELD_3BD (ref [rcount1 ], lastpt_ref , 0 );
9986
- }
9984
+ AcDbOsnapPointRef_fields (rcount1 )
9987
9985
SET_PARENT_OBJ (ref [rcount1 ]);
9988
9986
END_REPEAT_BLOCK
9987
+ if (FIELD_VALUE (ref [0 ].has_lastpt_ref )
9988
+ || FIELD_VALUE (ref [1 ].has_lastpt_ref )
9989
+ || FIELD_VALUE (ref [2 ].has_lastpt_ref )
9990
+ || FIELD_VALUE (ref [3 ].has_lastpt_ref ))
9991
+ {
9992
+ AcDbOsnapPointRef_fields (4 )
9993
+ }
9994
+ if (FIELD_VALUE (ref [4 ].has_lastpt_ref ))
9995
+ {
9996
+ AcDbOsnapPointRef_fields (5 )
9997
+ }
9989
9998
END_REPEAT (ref )
9990
9999
9991
10000
START_OBJECT_HANDLE_STREAM ;
0 commit comments