Jump to content

Recommended Posts

Posted

Please help!

I have a routine that will update a block attribute from another block attribute. It works well and is quite versatile.

Anyway, after selecting the source block the code asks to "Select Addresses" [see below]. At that point I have to type "CP" into the command window and hit the Enter key to select blocks with a polygon. I would like the code to go into the "CP" mode without me having to type it in.

 

 
 ;reset variables
 (setq tag_found nil)
 (setq setset nil)
  ; get end block
  (while (/= tag_found "true")
  (princ "\nSelect Addresses ")(princ (chr 34))(princ stag_end)(princ (chr 34))
  (setq selset  (ssget '((0 . "INSERT"))))

 

Thanks for any help.

Posted

When asked to select hold left mouse buton down and Drag

 

towards right is within window

towards left is crossing window

Posted

I appreciate the response but that won't solve my problem.

Normally, selections are oddly shapped. I need to just select the blocks that need updated. The selection may include 12 or more oddly shapped points.example.bmp

Posted

Do the blocks that need updating/matching have the same name?

Posted

Try

(setq selset (ssget "_CP" '((0 . "insert"))))

 

BTW... it's all there in Developer Help under ssget

Posted

No that doesn't work, if you use "cp" with ssget you need to supply a point list.

 

I was thinking use (command "select" "cp" ....) then (ssget "p" etc.. but I couldn't get the "select" to end without user hitting "enter" so it doesn't save eliminate those dratted keystrokes :)

Posted
;reset variables
 (setq tag_found nil)
 (setq setset nil)
; get end block
  (while (/= tag_found "true")
      (princ "\nSelect Addresses ")
      (princ (chr 34))
      (princ stag_end)
      (princ (chr 34))
      (command "select" "cp")
      (setq selset  (ssget "p" '((0 . "INSERT"))))

works though. It's kinda ugly. I would prefer personally to not have the select prompt vanish automatically anyway.

Posted

I had to add a "pause" to get it to work, as in:

 

(command "select" "cp" pause)

(setq selset (ssget "p" '((0 . "INSERT"))))

Posted

Well the code does stop and lets me polygon around the blocks but the code won't run past that point.

I appreciate everyones help. I guess I will have to live with the original code.

 

Thanks again.

Posted

The code keeps running for me, but only after a few "enters" after the select.

Posted

No matter what you do you will have to tell the program when to stop when making a crossing polygon because it could be 3 points or 300. if you don’t want to hit the enter key change your right click on the mouse to be enter.

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