sevdo2000 Posted April 14, 2010 Posted April 14, 2010 I have no word to say Lee. Two words may be - perfect work and thank you. It's so usefull, safe time and so on. I'd done already my own buttons (and short keywords) for these lisps and use them at 100% of my working time . If I have to be honest, I'd made some corrections to it for fields in the lisp. I have no experience for making lisps, for fields - little more. I'd tried to change lisp with the request in the last post to you, but I've never do that - it is knowledge for another dimension, so I'd asked you ... Thank you again. Quote
kheajohn Posted September 3, 2010 Posted September 3, 2010 Dear Lee Mac, You are really amazing...i've been looking for this routine for years....Thank you (english), Salamat (filipino), shokran (arabic) Can you give me your email add? Quote
Lee Mac Posted September 3, 2010 Posted September 3, 2010 Dear Lee Mac, You are really amazing...i've been looking for this routine for years....Thank you (english), Salamat (filipino), shokran (arabic) Can you give me your email add? You're very welcome, I'm glad you like it. Quote
wjp3wjp3 Posted March 14, 2012 Posted March 14, 2012 Lee Mac: Everyone seems to have success with this but me. After selecting the polyline and the text I get this message: ** Error: ActiveX Server returned the error: unknown name: GETOBJECTIDSTRING ** I am using AutoCAD 2008 SP 1 on Windows 7 64 bit. I have been trying to find a replacement for an areatag lisp similar to yours that worked fine on 32x put does not work on 64x. Any thoughts? Thanks, John Quote
Lee Mac Posted March 14, 2012 Posted March 14, 2012 Hi John, I believe I know where the problem lies, however, there are quite a few code posts in this thread, which post are you referring to? Lee Quote
wjp3wjp3 Posted March 14, 2012 Posted March 14, 2012 (edited) Lee, I have had trouble with any lisp routine that uses a variant of GETOBJECTIDSTRING. I tried a number of yours from this thread and always got the same result. This post claims that GETOBJECTIDSTRING is not available in AutoCAD 2008: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Area-Label-64bit-problem/td-p/2372205/page/2 In the same thread I found a routine posted by one of the contributors that gets the job done, although it is not the cleanest code. It works, however, so I am happy. I would welcome any thoughts on tightening up the code: From http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Area-Label-64bit-problem/td-p/2372205 (defun GetObjectID(ename / handle xUSERS1 obj objID) (if (= (getenv "PROCESSOR_ARCHITECTURE") "x86") (progn ;32-bit (setq obj (vlax-ename->vla-object ename) objID (itoa (vla-get-objectid obj)) ) ) (progn ;64-bit (setq handle (cdr (assoc 5 (entget ename)))) (command ".VBASTMT" (strcat "ThisDrawing.SetVariable \"USERS1\", CStr(ThisDrawing.HandleToObject(\"" handle "\").ObjectId)")) (setq objID (getvar "USERS1")) ) ) objID ) Thanks. John Edited March 15, 2012 by wjp3wjp3 Putting code in snippets Quote
Lee Mac Posted March 14, 2012 Posted March 14, 2012 Hi John, Try this program on my site, hopefully it will work on your system: http://lee-mac.com/areastofield.html Cheers, Lee Quote
SLW210 Posted March 15, 2012 Posted March 15, 2012 wjp3wjp3, Please read the CODE POSTING GUIDELINES and edit yoiur post. Quote
wjp3wjp3 Posted March 15, 2012 Posted March 15, 2012 (edited) My apologies, SLW210, I am new to the forum. My post has been edited with the code brackets. -John Edited March 15, 2012 by wjp3wjp3 Quote
SLW210 Posted March 15, 2012 Posted March 15, 2012 My apologies, SLW210, I am new to the forum. My post has been edited with the code brackets. But now that I have edited it it has disappeared from the thread! What happened? -John Thanks, post needed to be approved because of the links. Until you get 10 posts anything you post with links needs approval by a moderator. Should be there now. Quote
wjp3wjp3 Posted March 15, 2012 Posted March 15, 2012 Lee: If I understand what is happening with this, it is successfully detecting that getobjectidstring is not an applicable method, but as a result it the object ID is incorrect in the field it generates. This was the original problem that started me on my search for a 64bit compliant routine. This is the field that resulted from using the A2F routine in AutoCAD 2008 64 bit on Windows 7: %%).Area \f "%lu6%qf1">% I will stick with what I posted before. It is working. Thanks, John Quote
Lee Mac Posted March 15, 2012 Posted March 15, 2012 I thought you may have been running a 32-bit version of CAD on a 64-bit machine, hence maybe the getobjectidstring method wasn't implemented, but as you say, maybe 2008 doesn't offer this method. The workaround that you are using uses a VBA statement to set the ObjectID to the USERS1 System Variable; just be aware that this may not work in later versions where VBA is not supported. Lee Quote
wjp3wjp3 Posted March 15, 2012 Posted March 15, 2012 Thanks, Lee. I will keep your routines in my back pocket for when we upgrade AutoCAD. I have only seen one forum post that indicates that ACAD2008 x64 does not support getobjectidstring, but that seems to be the only explanation for why these don't work. -John Quote
Dynaformer Posted March 16, 2012 Posted March 16, 2012 Hi guys, Could one of you help? Is there a way to add and subtract areas of several polylines by modifying this lisp? Your help is much appreciated. Quote
LIXBERTSILLA Posted April 22, 2014 Posted April 22, 2014 Hello, can i ask help, i also have problem about cumulative area and lengths, how can i get those cumulative areas display in the properties? and about codes, how can i use it or where will i paste it? thank you so much. Quote
megamattus Posted May 9, 2018 Posted May 9, 2018 Happy to help Frank Hi Lee! I´m a newbie to LISP coding. I have to solve something similar. I already have a very large facility CAD plans, populated with room tag blocks with ATTRIB MTEXTs. I have to export all that data (already done with dataextraction)to excel. option 1: Since the goal to achieve is a Room Data sheet, I also need areas and permieters. So the question is: how can I implement that function into an existing and populated block? option 2: Otherwise, it would be useful to obtain the ObjectID of an external Polyline. If I knew how to do that, y think I could manage to solve the problem. option 3: Is there any way of building a block that contains a polyline inside, which can be eddited (not only stretched) as a block attribute without entering the block editor? If so, i could manage a FIELD formula to extract the area from that specific polyline, which must be unique (and not repeated through the other block instances) Tnaks a lot! regards, Matias 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.