« Accessing Information About Layers in a Drawing with GETPROPERTYVALUE | Main | Getting User Input with AutoLISP and Handling ESC »

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83420642b53ef015390d9e385970b

Listed below are links to weblogs that reference Creating Objects without the COMMAND Function in AutoCAD:

Comments

John Loudermilk

Lee,
How about creating a more complex object using ENTMAKE like a multileader? What would the code look like to do that?

Lee Ambrosius

Let me see what I can cook up... I know I have been thinking about Table Styles as well for a future article.

Lee Ambrosius

I did a bit of digging and here is what I came up with, there might be some codes that cane be trimmed down to create a basic Mleader. You need to define the number of points you want in he Mleader when creating it as there does not seem to be a way to add additional points from what I noticed at a quick glance.

;; Mleader framework - Straight - 3 point
(setq newObj (entmakex '((0 . "MULTILEADER")
(100 . "AcDbEntity")
(100 . "AcDbMLeader")

;; No content
(300 . "CONTEXT_DATA{")
(10 22.4318 7.96727 0.0) ;; Start landing
(110 20.7384 6.13904 0.0) ;; Endpoint
(297 . 0)

;; Leader and landing
(302 . "LEADER{")
(290 . 1)
(291 . 1)
(10 22.4318 7.96727 0.0) ;; Start landing
(11 1.0 0.0 0.0)
(90 . 0)
(40 . 0.36)
(304 . "LEADER_LINE{")
(10 20.7384 6.13904 0.0) ;; Endpoint
(10 21.4304 7.79070 0.0) ;; Next point
(91 . 0)
(170 . 1)
(92 . -1056964608)
(171 . -2)
(40 . 0.0)
(93 . 0)
(305 . "}")
(271 . 0)
(303 . "}")
(272 . 9)
(273 . 9)
(301 . "}")
))
)

;; Mleader framework - Spline - 1 point
(setq newObj (entmakex '((0 . "MULTILEADER")
(100 . "AcDbEntity")
(100 . "AcDbMLeader")
(300 . "CONTEXT_DATA{")
(10 22.8629 7.06467 0.0)
(110 21.9268 5.87439 0.0)
(297 . 0)
(302 . "LEADER{")
(290 . 1)
(291 . 1)
(10 22.5029 7.06467 0.0)
(11 1.0 0.0 0.0)
(90 . 0)
(40 . 0.36)
(304 . "LEADER_LINE{")
(10 21.9268 5.87439 0.0)
(91 . 0)
(170 . 1)
(92 . -1056964608)
(171 . -2)
(40 . 0.0)
(93 . 0)
(305 . "}")
(271 . 0)
(303 . "}")
(272 . 9)
(273 . 9)
(301 . "}")

;; 90 and 170 control Spline behavior
(90 . 1025)
(170 . 2)
))
)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.