wimal Posted August 1, 2019 Posted August 1, 2019 I want to find out the block name of the leader head by LISP. Pl can somebody help me. Quote
Emmanuel Delay Posted August 1, 2019 Posted August 1, 2019 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 1 Quote
Lee Mac Posted August 1, 2019 Posted August 1, 2019 (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 August 1, 2019 by Lee Mac 1 Quote
wimal Posted August 1, 2019 Author Posted August 1, 2019 (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 Quote
wimal Posted August 1, 2019 Author Posted August 1, 2019 1 hour ago, ronjonp said: Hint: vla-get-arrowheadblock (setq BlockName (vla-get-ArrowheadBlock le1)) Nothing happend Quote
ronjonp Posted August 1, 2019 Posted August 1, 2019 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" 1 Quote
Lee Mac Posted August 1, 2019 Posted August 1, 2019 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))))) ) ) 1 Quote
Recommended Posts
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.