Jump to content

Recommended Posts

Posted

I want to find out the block name of the leader head by LISP.

Pl can somebody help me. 

Posted

It's not a block.

It's a solid. 

It's more or less (type in Autocad): SOLID => 0,0 =>1,0 => 0.5,3 => Enter

 

  • Like 1
Posted (edited)

Assuming a MULTILEADER, query DXF group 2 of the DXF data associated with the last DXF group 342 entity, e.g.:

(cdr (assoc 2 (entget (cdr (assoc 342 (reverse (entget <leader>)))))))

 

Edited by Lee Mac
  • Like 1
Posted
(entget le1)

;;; result is ((-1 . <Entity name: 7ff49cf18600>) (0 . "LEADER") (330 . <Entity name: 7ff49cf039f0>) (5 . "558") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "s-beam") (100 . "AcDbLeader") (3 . "ISO-25") (71 . 1) (72 . 0) (73 . 3) (74 . 1) (75 . 0) (40 . 0.0) (41 . 0.0) (76 . 3) (10 18794.2 7331.95 0.0) (10 18919.2 7331.95 0.0) (10 18794.2 7331.95 0.0) (340 . <Entity name: 0>) (211 1.0 0.0 0.0) (210 0.0 0.0 1.0) (212 0.0 0.0 0.0) (213 0.0 0.0 0.0)) 
  
  (entget (cdr (assoc 330 (reverse (entget le1)))))
  ;;; result is
  ((-1 . <Entity name: 7ff49cf039f0>) (0 . "BLOCK_RECORD") (5 . "1F") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 7ff49cf04660>) (102 . "}") (330 . <Entity name: 7ff49cf03810>) (100 . "AcDbSymbolTableRecord") (100 . "AcDbBlockTableRecord") (2 . "*Model_Space") (360 . <Entity name: 7ff49cf03a00>) (340 . <Entity name: 7ff49cf03a20>) (70 . 0) (280 . 1) (281 . 0)) 

No dxf group 342 found. The solution must be very near.Pl help

Posted
3 minutes ago, wimal said:

(setq BlockName (vla-get-ArrowheadBlock le1))

Nothing happend

Did you convert to vla-object?

 

Works here:

(if (setq o (car (entsel)))
  (print (vla-get-arrowheadblock (vlax-ename->vla-object o)))
)
"ArchTick"

 

  • Thanks 1
Posted
2 hours ago, wimal said:

(entget le1)

;;; result is ((-1 . <Entity name: 7ff49cf18600>) (0 . "LEADER") (330 . <Entity name: 7ff49cf039f0>) (5 . "558") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "s-beam") (100 . "AcDbLeader") (3 . "ISO-25") (71 . 1) (72 . 0) (73 . 3) (74 . 1) (75 . 0) (40 . 0.0) (41 . 0.0) (76 . 3) (10 18794.2 7331.95 0.0) (10 18919.2 7331.95 0.0) (10 18794.2 7331.95 0.0) (340 . <Entity name: 0>) (211 1.0 0.0 0.0) (210 0.0 0.0 1.0) (212 0.0 0.0 0.0) (213 0.0 0.0 0.0)) 
  
  (entget (cdr (assoc 330 (reverse (entget le1)))))
  ;;; result is
  ((-1 . <Entity name: 7ff49cf039f0>) (0 . "BLOCK_RECORD") (5 . "1F") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 7ff49cf04660>) (102 . "}") (330 . <Entity name: 7ff49cf03810>) (100 . "AcDbSymbolTableRecord") (100 . "AcDbBlockTableRecord") (2 . "*Model_Space") (360 . <Entity name: 7ff49cf03a00>) (340 . <Entity name: 7ff49cf03a20>) (70 . 0) (280 . 1) (281 . 0)) 

No dxf group 342 found. The solution must be very near.Pl help

 

Sorry for the confusion - my suggestion was applicable to a MULTILEADER entity, not a LEADER.

 

For a LEADER entity, you can either use the ActiveX arrowheadblock property as @ronjonp correctly suggests, or query the arrowhead block associated with the Dimension Style or Dimension Style override used by the LEADER entity as demonstrated by the following function:

(defun leaderarrowheadblock ( ent / def enx xdd )
    (if
        (and
            (setq enx (entget ent '("acad")))
            (setq xdd (member '(1070 . 341) (cdadr (assoc -3 enx))))
            (setq def (handent (cdr (assoc 1005 xdd))))
        )
        (cdr (assoc 2 (entget def)))
        (cdr (assoc 5 (tblsearch "dimstyle" (cdr (assoc 3 enx)))))
    )
)

 

  • Like 1

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...