Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-30, 12:48 AM   #1
vlee
Member
 
Join Date: 2001-12
Posts: 29
vlee is starting their journey
Unhappy Block with attrib using entmake

Can someone give me an example on how to create a block with attributes using entmake.
I can create a block, but when I entmake to create the attribute, it returns nil.
I am not sure which dotted pair is required for the (0 . "ATTRIB")

Any assistance would be appreciated
vlee is offline   Reply With Quote
Old 2004-06-30, 09:50 AM   #2
David.Hoole
Active Member
 
David.Hoole's Avatar
 
Join Date: 2000-12
Location: Yorkshire
Posts: 81
David.Hoole has a bright futureDavid.Hoole has a bright futureDavid.Hoole has a bright futureDavid.Hoole has a bright futureDavid.Hoole has a bright futureDavid.Hoole has a bright future
Default RE: Block with attrib using entmake

Hi vlee

Here's a very simple example which creates a block called "revmk", with a single attribute. Make sure the text style called by the attribute derfinition (romans in this case) exists in the drawing before running the code.

;code start
Code:
(entmake '((0 . "block")
           (2 . "revmk")
           (10 0.0 0.0 0.0)
           (70 . 2)
          )
)
(entmake '((0 . "attdef")
           (8 . "revision")
           (10 0.0 0.0 0.0)
           (40 . 2.5)
           (41 . 0.8)
           (72 . 4)
           (73 . 2)
           (1 . "rev")
           (7 . "romans")
           (3 . "Enter revision")
           (2 . "rev")
           (70 . 4)
          )
)
(entmake '((0 . "line")
           (8 . "revision")
           (62 . 1)
           (10 -3.5 -2.0207 0.0)
           (11 3.5 -2.0207 0.0)
          )
)
(entmake '((0 . "line")
           (8 . "revision")
           (62 . 1)
           (10 3.5 -2.0207 0.0)
           (11 0.0 4.0415 0.0)
          )
)
(entmake '((0 . "line")
           (8 . "revision")
           (62 . 1)
           (10 0.0 4.0415 0.0)
           (11 -3.5 -2.0207 0.0)
          )
)
(entmake '((0 . "endblk")))
;code end
__________________
Regards,

David

Last edited by Glenndp : 2004-06-30 at 04:29 PM. Reason: Placed routine in code tags
David.Hoole is offline   Reply With Quote
Old 2004-06-30, 04:45 PM   #3
peter
Vice President / Director
 
peter's Avatar
 
Join Date: 2000-09
Location: Kenosha Wisconsin
Posts: 375
peter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the starspeter is shooting for the stars
Default RE: Block with attrib using entmake

Just for the other way of doing this...

Code:
(defun C:AddNewBlock (/ objNewBlock)
 (setq objNewBlock (vla-add  
                    (vla-get-blocks
                     (vla-get-activedocument
                      (vlax-get-acad-object)
                     )
                    )
                    (vlax-3d-point (list 0.0 0.0 0.0))
                    "MyNewBlock"
                   )
 )
 (print "x")
 (vla-addattribute objNewBlock
                   (/ (getvar "dimscale") 10.0)
                   8
                   "UserPrompt"
                   (vlax-3d-point (list 0.0 0.0 0.0))
                   "UserTagString"
                   "UsertTextValue"
 )
)
Peter Jamtgaard
peter is offline   Reply With Quote
Old 2004-06-30, 05:00 PM   #4
vlee
Member
 
Join Date: 2001-12
Posts: 29
vlee is starting their journey
Default RE: Block with attrib using entmake

Thank you for you responses. Works great.
vlee is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiview Block edit BCrouse ACA Wish List 6 2004-11-25 04:42 AM
Block Changes cgraham ACA General 2 2004-06-30 01:17 PM
Adding layer intelligence to a Block cadconcepts AutoLISP 4 2004-06-22 07:56 PM
Scaling Points in Block jcronburg ACA General 3 2004-06-10 07:21 PM
glass block and view range sfaust Revit Architecture - Families 2 2004-04-09 03:18 AM


All times are GMT +1. The time now is 03:16 PM.