Jump to content

Modify a selected block, keep other blocks with the same name intact


Recommended Posts

Posted

Hi forum

Is it possible to modify a selected block, keeping other blocks with the same name intact. For more details please refer to the image attached.q1.jpg

 

Thanks

Posted

Make the block dynamic and add the two shapes to the block on the two sides and that would be much better than a adding two separate blocks on the two sides.

Posted

Tharwat

 

My block looses its dynamical properties when i scale it, and i scale it for following reasons

q3.JPG

 

samifox

 

The referred function requires Standard INSERT ename. I don't know what it is exactly but wherever i use my block name "blk" or # for the argument i get this message

*** Not A Changeable Block ***

Posted

Thank you for trying to solve my problem ,but there is a distortion of a hatch

q4.jpg

Posted

I am giving you an example of how to create the Dynamic Block with parameters so you can adjust and modify the Hatch resolution and looking as best as you want.

Posted

Where do i play with hatch resolution, a quich search did't give me answer

Posted

Double click on the Block to open the Block Editor and adjust it to your needs.

Posted

Do me a favor. Try to prolong the pipe until you get a distortion then tell me the steps how to adjust the resolution after accessing block editor and clicking on hatch please.

Even if it works this takes less clicks

(defun c:NP (/ pt1 pt2)

 (defun open_dbx (dwg / dbx)
   (if	(< (atoi (substr (getvar "ACADVER") 1 2)) 16)
     (setq dbx (vlax-create-object "ObjectDBX.AxDbDocument"))
     (setq dbx	(vlax-create-object
	  (strcat "ObjectDBX.AxDbDocument."
		  (substr (getvar "ACADVER") 1 2)
	  )
	)
     )
   )
   (vla-open dbx dwg)
   dbx
 )
 (setq Dbx (open_dbx "c:/Users/the good custumer/Desktop/PrepAutocad/Pipes.dwg"))	; Change the file name here
 (vla-CopyObjects
   Dbx
   (vlax-safearray-fill
     (vlax-make-safearray vlax-vbObject '(0 . 0))
     (list (vla-item (vla-get-blocks dbx) "NP"))
				; Change the block name here
   )
   (vla-get-blocks
     (vla-get-activedocument (vlax-get-acad-object))
   )
 )
 (vlax-release-object dbx)

 (if (and (setq pt1 (getpoint "\nPick Insertion point."))
   (not (initget 32))
   (setq pt2 (getpoint pt1 "\nPick Insertion point."))
   (setq ang1 (angle pt1 pt2))
   (setq ang2 (/ (* ang1 180.0) pi))

     )
   (command "._-insert"
     "NP"
     "_non"
     pt1
     (distance pt1 pt2)
     "1"
     ang2
   )
 )
 (princ)
)

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