Jump to content

Stepping through subentity list


rj2gregory

Recommended Posts

I wish to create a valid association with a txt label, that currentlydepicts length, with the appropriate three vertices polyline. The midpoint ofthe polyline and the text label “insertion point” are identical.

Command:

((-1 . ) (0 ."POLYLINE") (330 . ) (5 ."2B6") (100 . "AcDbEntity") (67 . 0) (410 ."Model") (8 . "HALCON_8000_LATERALS") (100 . "AcDb2dPolyline")(66 . 1) (10 0.0 0.0 0.0) (70 . 0) (40 . 118.75) (41 . 118.75) (210 0.0 0.01.0) (71 . 0) (72 . 0) (73 . 0) (74 . 0) (75 . 0))

((-1 . ) (0 ."VERTEX") (330 . ) (5 ."2C8") (100 . "AcDbEntity") (67 . 0) (410 ."Model") (8 . "HALCON_8000_LATERALS") (100 . "AcDbVertex")(100 . "AcDb2dVertex") (10 3.54891e+006 1.02421e+007 0.0) (40 .118.75) (41 . 118.75) (42 . 0.0) (91 . 0) (70 . 0) (50 . 0.0))

((-1 . ) (0 ."VERTEX") (330 . ) (5 ."2C9") (100 . "AcDbEntity") (67 . 0) (410 ."Model") (8 . "HALCON_8000_LATERALS") (100 ."AcDbVertex") (100 . "AcDb2dVertex") (10 3.55227e+0061.02387e+007 0.0) (40 . 118.75) (41 . 118.75) (42 . 0.0) (91 . 0) (70 . 0) (50. 0.0))

((-1 . ) (0 ."VERTEX") (330 . ) (5 ."2CA") (100 . "AcDbEntity") (67 . 0) (410 ."Model") (8 . "HALCON_8000_LATERALS") (100 ."AcDbVertex") (100 . "AcDb2dVertex") (10 3.55564e+0061.02354e+007 0.0) (40 . 118.75) (41 . 118.75) (42 . 0.0) (91 . 0) (70 . 0) (50. 0.0))

((-1 . ) (0 ."SEQEND") (330 . ) (5 ."2CB") (100 . "AcDbEntity") (67 . 0) (410 ."Model") (8 . "HALCON_8000_LATERALS") (-2 . ))

((-1 . ) (0 . "TEXT")(330 . ) (5 . "2D3") (100 ."AcDbEntity") (67 . 0) (410 . "Model") (8 ."HALCON_LATERALS_8000_FEET_TXT") (100 . "AcDbText") (103.55127e+006 1.02398e+007 0.0) (40 . 200.0) (1 . "9500' LATERAL 810")(50 . 5.50074) (41 . 1.0) (51 . 0.261799) (7 . "AB") (71 . 0) (72 .1) (11 3.55227e+006 1.02387e+007 0.0) (210 0.0 0.0 1.0) (100 ."AcDbText") (73 . 1))

Command:

I understand how to view the DXG codes for the polylinesubentity vertices and the DXF codes for the text string, but lack theknowledge to step through the polyline’s subentity list, isolate or assign thesecond vertices (assoc 10) to a variable and then create the desired associationwith the appropriate text string’s (assoc 11).

My objective is to sweep through a DWG file that depictsseveral horizontal well laterals as three vertices polylines and their accompanyingtext labels and then modify each text label to include each polyline’s entityhandle. The entity handle is used as a unique identifier which I export to variousExcel files.

I have a rudimentary lisp routine that allows me to select apolyline, the appropriate text string and then add the polyline’s entity handleto the “selected” text string. But I want to to create a selection set(s) ofpolylines and text strings and have a more advanced program loop through and correctlymodify the selection sets across the DWG file without having to individually selecteach polyline and text string with user input.

Any enlightenment on this issue would be greatlyappreciated.

Link to comment
Share on other sites

Rather than attempting to programmatically pair each iterated Text entity, with it's corresponding iterated Curve entity, why not simply create a selection set, and as you iterate the selection set once, delete any text entities, and create new one's based upon the Curve entity's handle?

 

If you really wanted to make it specific, you could iterate the selection set CONDitionally storing each to a separate list (one for Text, another for Curves), and then compare each list's Length before further processing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...