iDeeW Posted July 22, 2013 Posted July 22, 2013 (edited) Hi, I'm a LISP newbie and this is my first post. Thank you in advance for your valuable time spending on me. I need to find out whether there is any objects/blocks laying outside my title block boarder (example attached). Then prompt the user & ask to remove them from the drawing or not. If YES, need to delete all outside objects. Finally save it if there is a change. Need to do it all in VLisp....! Please help me out. C__Users_iweerasinghe_Desktop_147970_1479702I8025 Model (1).pdf 1479702I8025.dwg Edited July 23, 2013 by iDeeW Quote
pBe Posted July 23, 2013 Posted July 23, 2013 Somehow your drawing file is invlaid: If the border is a BLOCK entity then its easy , Question for you: Are there more than 1 border on your drawing? if yes are they all on the same layout? Quote
iDeeW Posted July 23, 2013 Author Posted July 23, 2013 I have only one boarder & it is a block entity... I'm using AutoCAD 2013...I'm attaching it again for your reference... 1479702I8025.dwg Quote
Tharwat Posted July 23, 2013 Posted July 23, 2013 The block is really very odd when you use the function on it vla-getboundingbox , actually it give the low left and the upper right points outside the block limits ( boundary ) . Quote
iDeeW Posted July 23, 2013 Author Posted July 23, 2013 I think your correct ....there are multiple boarders on my drawing... uploading again...1479702I8025.dwg Quote
Tharwat Posted July 23, 2013 Posted July 23, 2013 I think your correct ....there are multiple boarders on my drawing... I wrote a piece of code at the office today and it did work well except on your block , so that's why I did not post the code . Quote
iDeeW Posted July 23, 2013 Author Posted July 23, 2013 (edited) I tried this code ..but nothing returns [i](defun c:al-getboundingbox () (vl-load-com) (setq util (vla-get-utility (vla-get-activedocument (vlax-get-acad-object)))) (vla-getentity util 'obj 'ip "\nSelect Object: ") (vla-GetBoundingBox obj 'minpoint 'maxpoint) ;minpoint contains the minimum point of the bounding box ;maxpoint contains the maximum point of the bounding box (princ minpoint) (terpri) (princ maxpoint) (princ) );defun[/i] Edited July 25, 2013 by iDeeW Quote
iDeeW Posted July 24, 2013 Author Posted July 24, 2013 I wrote a piece of code at the office today and it did work well except on your block , so that's why I did not post the code . Would you care to share it... Quote
Tharwat Posted July 24, 2013 Posted July 24, 2013 Would you care to share it... Sure , but it does not work with the block that you wanted to play the code with , and I can say that something wrong with that block undoubtedly . Quote
iDeeW Posted July 24, 2013 Author Posted July 24, 2013 Sure , but it does not work with the block that you wanted to play the code with I'll give a try...at least I have a starting point:shock: and I can say that something wrong with that block undoubtedly . can you please explain a bit more... Quote
SLW210 Posted July 25, 2013 Posted July 25, 2013 Please read the Code posting guidelines and place your code in code tags. Quote
GP_ Posted July 25, 2013 Posted July 25, 2013 The block is really very odd when you use the function on it vla-getboundingbox... Maybe with trans. Quote
iDeeW Posted July 25, 2013 Author Posted July 25, 2013 I understand using vla-getboundingbox to get the min & max points...but what if there is an object outside the boarder ....I need to detect that before using vla-getboundingbox....!!? 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.