mrthra Posted June 23, 2010 Share Posted June 23, 2010 Morning! Very simply, I have a drawing with houses and gardens in plan. I am writing a routine which will pick and extract the house number text then pick round area of the garden and write both to a text file. My problem is running the area command in Autolisp. As shown below, i start the area command and add a pause so i can pick round the perimeter of the garden. This doesnt seem to work?!! Any clues?? (command "area" pause) (setq aa (getvar "area") I use old skool lisp, so VBA is over my head! regards Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 23, 2010 Share Posted June 23, 2010 Try to list programmatically the area instead of using the command: (vl-load-com) (setq MyEntity (vlax-ename->vla-object MyEntity)) (if (vlax-property-available-p MyEntity "area") (vlax-get (vlax-ename->vla-object (entlast)) "area") 0.0 ) Regards Quote Link to comment Share on other sites More sharing options...
mrthra Posted June 23, 2010 Author Share Posted June 23, 2010 Try to list programmatically the area instead of using the command: (vl-load-com) (setq MyEntity (vlax-ename->vla-object MyEntity)) (if (vlax-property-available-p MyEntity "area") (vlax-get (vlax-ename->vla-object (entlast)) "area") 0.0 ) Regards Thanks - however i want to pick points rather than select an object. Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 23, 2010 Share Posted June 23, 2010 So pick the points: (defun _Area (/ val) (setq val (getvar 'area)) (command "_.area") (while (< 0 (getvar 'cmdactive)) (progn (princ "\nSpecify point: ") (command PAUSE) ) ) (if (not (member (getvar 'area) (list val 0.))) (getvar 'area) ) ) Personally, I'd do it this way (minus use of command and plus nice display), but we'll keep things simple to begin with: Quote Link to comment Share on other sites More sharing options...
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.