Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
By using following code, I received output as mentioned below
(setq vlentity (vlax-ename->vla-object (car (entsel))))
(setq dict (vla-GetExtensionDictionary vlentity))
(setq eobjId (vla-get-objectid vlentity))
(setq xdTypes (vlax-make-safearray vlax-vbInteger '(0 . 0)))
(vlax-safearray-fill xdTypes (list 340))
(setq xdTypes (vlax-make-variant xdTypes))
(setq xdValues (vlax-make-safearray vlax-vbVariant '(0 . 0)))
(setq xdObject (vlax-make-variant vlentity))
(vlax-safearray-fill xdValues (list xdObject))
(setq xdValues (vlax-make-variant xdValues))
(setq xrecord (vla-AddXRecord dict "MyText"))
(vla-SetXRecordData xrecord xdTypes xdValues)
<Entity name: 2bb593a8320>
((-1 . <Entity name: 2bb593a8320>) (0 . "DICTIONARY") (330 . <Entity name: 2bb593a8310>) (5 . "20C1A") (100 . "AcDbDictionary") (280 . 1) (281 . 1) (3 . "MyText") (360 . <Entity name: 2bb593a8330>))
<Entity name: 2bb593a8330>
((-1 . <Entity name: 2bb593a8330>) (0 . "XRECORD") (5 . "20C1B") (102 . "{ACAD_REACTORS") (330 . <Entity name: 2bb593a8320>) (102 . "}") (330 . <Entity name: 2bb593a8320>) (100 . "AcDbXrecord") (280 . 1) (340 . <Entity name: 2bb593a8310>))
I need to populate 310 DXF code as Xrecord as under, I tried my best to populate but not able to attach as required. Please guide me what changes I need to make in the code. Thx in advance.
<Entity name: 2bb593a0520> ((-1 . <Entity name: 2bb593a0520>) (0 . "DICTIONARY") (330 . <Entity name: 2bb593a0510>) (5 . "20AD2") (100 . "AcDbDictionary") (280 . 1) (281 . 1) (3 . " MyText ") (360 . <Entity name: 2bb593a0530>))
<Entity name: 2bb593a0530> ((-1 . <Entity name: 2bb593a0530>) (0 . "XRECORD") (5 . "20AD3") (102 . "{ACAD_REACTORS") (330 . <Entity name: 2bb593a0520>) (102 . "}") (330 . <Entity name: 2bb593a0520>) (100 . "AcDbXrecord") (280 . 1) (310 . "123456789ABCDEF101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748") (310 . "123456789ABCDEF101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748"))
Regards,
Raj
Solved! Go to Solution.