Object ID for area field
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Object ID for area field

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Clarence
Guest





Posted: Fri Dec 17, 2004 11:04 pm    Post subject: Object ID for area field Reply with quote

I am currently working on an autolisp command that will make an area field for a polyline. I have figured out everything except how to get and use the object id. I keep getting an error:

bad argument type: stringp 2128026136

That number is the object id, but I can't get the command to use it tho.

Can someone help please?!?!?!

here's the command:

(defun c:ASF (/ ent)
(command "undo" "g")
(setq olderr *error*)
(defun *error* (errmes)
(princ
(strcat "\n Area (Sq. Ft.) by Polyline halted by: \n"
errmes
)
)
(command "undo" "end")
(setq *error* olderr)
(command "undo" "1")
(prin1)
)
(vl-load-com)
(PROMPT "\n\nArea (S.F.) by Polyline....\n")
(setq setosm (getvar "osmode"))
(setvar "osmode" 16384)
(setq ent (vlax-ename->vla-object (car (entsel "pick"))))
(setq objidlwpoly (vla-get-objectid ent))
(setq atfield
(strcat
"%<\\AcObjProp Object(%<\\_ObjId "
objidlwpoly
">%).Area \\f \"%lu2%ct4%qf1 SQ. FT.\">%"
)
)
(command "mtext" pause pause atfield "")
(vlax-release-object ent)
(setvar "osmode" setosm)
(command "cmdecho" 1)
(setq *error* olderr)
(command "undo" "end")
(princ userobjid)
(princ)
)

Back to top
BillZ
Guest





Posted: Fri Dec 17, 2004 11:23 pm    Post subject: Re: Object ID for area field Reply with quote

strcat expecta a string.

(itoa objidlwpoly)


Bill
Back to top
Jeff Mishler
Guest





Posted: Fri Dec 17, 2004 11:24 pm    Post subject: Re: Object ID for area field Reply with quote

ObjectID is an Integer........

--
Jeff
check out www.cadvault.com
"Clarence" <nospam@address.withheld> wrote in message
news:17205131.1103306729282.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
I am currently working on an autolisp command that will make an area field
for a polyline. I have figured out everything except how to get and use
the object id. I keep getting an error:

bad argument type: stringp 2128026136

That number is the object id, but I can't get the command to use it tho.

Can someone help please?!?!?!

here's the command:

(defun c:ASF (/ ent)
(command "undo" "g")
(setq olderr *error*)
(defun *error* (errmes)
(princ
(strcat "\n Area (Sq. Ft.) by Polyline halted by: \n"
errmes
)
)
(command "undo" "end")
(setq *error* olderr)
(command "undo" "1")
(prin1)
)
(vl-load-com)
(PROMPT "\n\nArea (S.F.) by Polyline....\n")
(setq setosm (getvar "osmode"))
(setvar "osmode" 16384)
(setq ent (vlax-ename->vla-object (car (entsel "pick"))))
(setq objidlwpoly (vla-get-objectid ent))
(setq atfield
(strcat
"%<\\AcObjProp Object(%<\\_ObjId "
objidlwpoly
">%).Area \\f \"%lu2%ct4%qf1 SQ. FT.\">%"
)
)
(command "mtext" pause pause atfield "")
(vlax-release-object ent)
(setvar "osmode" setosm)
(command "cmdecho" 1)
(setq *error* olderr)
(command "undo" "end")
(princ userobjid)
(princ)
)


Back to top
Clarence
Guest





Posted: Fri Dec 17, 2004 11:28 pm    Post subject: Re: Object ID for area field Reply with quote

I knew I was just overlooking something.....


Thank you thank you thank you!!!!!

BTW....its working GREAT!!!!!!
Back to top
BillZ
Guest





Posted: Fri Dec 17, 2004 11:41 pm    Post subject: Re: Object ID for area field Reply with quote

You're welcome,

Glad I could help.

Bill
Back to top
LUCAS
Guest





Posted: Mon Dec 20, 2004 8:52 am    Post subject: Re: Object ID for area field Reply with quote

http://new.cadalyst.com/code/browseyear.cfm?fullyear=2004#10

October 2004------Link Area Text to Boundary



"BillZ" <nospam@address.withheld> ¦b¶l¥ó
news:1758636.1103308894717.JavaMail.jive@jiveforum2.autodesk.com ¤¤¼¶¼g...
Quote:
You're welcome,

Glad I could help.

Bill
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB