AutoCAD Electrical General Discussion

Reply
Contributor
upscale
Posts: 11
Registered: ‎01-20-2004
Message 1 of 8 (122 Views)

Single Attribute Retrieve

122 Views, 7 Replies
01-20-2004 12:21 PM
I have been trying to get this to work, but with no luck, I still keep getting a nil value. The block is there, the attribute is there but no luck. Has anyone been able to do this?

Example: (c:wd_getattrval titleblock "31003.1")

Retrieve an attribute value from a block insert:
(c:wd_getattrval ( comp_en attrname )

comp_en = entity name of block insert
attrname = attribute name to find and retrieve
RETURN = attribute value (or nil if attribute not found)
*Jared Bunch \(Autodesk, Inc\)
Message 2 of 8 (122 Views)

Re: Single Attribute Retrieve

01-20-2004 01:02 PM in reply to: upscale
upscale Try it on an attribute that does not contain a decimal ( . ) point and see if it will work then. Let us know...... -- Regards, Jared Bunch Technical Support Specialist Autodesk, Inc "upscale" wrote in message news:8708197.1074630155961.JavaMail.javamailuser@localhost... > I have been trying to get this to work, but with no luck, I still keep getting a nil value. The block is there, the attribute is there but no luck. Has anyone been able to do this? > > Example: (c:wd_getattrval titleblock "31003.1") > > Retrieve an attribute value from a block insert: > (c:wd_getattrval ( comp_en attrname ) > > comp_en = entity name of block insert > attrname = attribute name to find and retrieve > RETURN = attribute value (or nil if attribute not found)
*Nate Holt \(Autodesk\)
Message 3 of 8 (122 Views)

Re: Single Attribute Retrieve

01-20-2004 02:29 PM in reply to: upscale
For a quick test, type this in at the AutoCAD command line: (c:wd_getattrval (car (entsel)) "31003.1") [Enter] You're prompted to pick an object. Pick on the block insert. See if it returns the value of attribute with a tag name of "31003.1"
Contributor
upscale
Posts: 11
Registered: ‎01-20-2004
Message 4 of 8 (122 Views)

Re: Single Attribute Retrieve

01-21-2004 05:02 AM in reply to: upscale
I tried it and it works. What I would like to do is to be able to is put in the block name and the attribute in the expression without having to manually pick the block. I have a project here where I have about 500 drawings from an outside vendor to put into our drawing system. I have to place another block on the drawings that is a vendor identification tag that contains our drawing number formats. I am using the title block update features to do this and would like to be able to read the existing titleblock information into this new block, using lisp routines.
Contributor
upscale
Posts: 11
Registered: ‎01-20-2004
Message 5 of 8 (122 Views)

Re: Single Attribute Retrieve

01-21-2004 05:06 AM in reply to: upscale
I tried it without the decimal point, but it still gives me the same results.
*Nate Holt \(Autodesk\)
Message 6 of 8 (122 Views)

Re: Single Attribute Retrieve

01-21-2004 07:11 AM in reply to: upscale
If there is only one instance of your title block on the drawing, the following expression should return the target attribute value. In this example, your title block name is "TBLOCK" and the attribute you want to grab is called "31003.1". You can make this a lot fancier and safer (adding some error checking), I've just encoded the simplest version into a single line as an example. (setq value (c:wd_getattrval (ssname (ssget "_X" '((2 . "TBLOCK"))) 0) "31003.1")) "upscale" wrote in message news:6641623.1074690203813.JavaMail.jive@jiveforum1.autodesk.com... > I tried it and it works. What I would like to do is to be able to is put in the block name and the attribute in the expression without having to manually pick the block. I have a project here where I have about 500 drawings from an outside vendor to put into our drawing system. I have to place another block on the drawings that is a vendor identification tag that contains our drawing number formats. I am using the title block update features to do this and would like to be able to read the existing titleblock information into this new block, using lisp routines.
Contributor
upscale
Posts: 11
Registered: ‎01-20-2004
Message 7 of 8 (122 Views)

Re: Single Attribute Retrieve

01-21-2004 11:04 AM in reply to: upscale
Thanks for the quick reply, there seems to be a glitch in it somewhere. I get a error "malformed list on input".
Contributor
upscale
Posts: 11
Registered: ‎01-20-2004
Message 8 of 8 (122 Views)

Re: Single Attribute Retrieve

01-21-2004 11:43 AM in reply to: upscale
My mistake, I copied it directly as it looked on the screen and it had the extra wrap around line in it. It works fine. Thanks for the help.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Ask the Community