Jump to content

Recommended Posts

Posted (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.:cry:

C__Users_iweerasinghe_Desktop_147970_1479702I8025 Model (1).pdf

1479702I8025.dwg

Edited by iDeeW
Posted

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?

Posted

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

Posted

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 ) . :shock:

Posted
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 .

Posted (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 by iDeeW
Posted
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...

Posted
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 .

Posted
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...:unsure:

Posted
The block is really very odd when you use the function on it vla-getboundingbox...

 

Maybe with trans.

Posted

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....!!?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...