Jump to content
gerardo2m

Set the property "InsUnits" in a block generated by ENTMAKE.

Recommended Posts

gerardo2m
Hi.
I am generating a block using ENTMAKE, but I have noticed that the property "InsUnits (RO)" indicates "Unitless".

The variable "INSUNITS of the document (drawing) is set to "6" for Meters, but when generating the Block the property is set as Unitless.

How do I assign the property to the BLOCK as this is the INSUNITS variable?
(defun ent-block (nameBlock pto-ins atrib-var / )

	(entmake 	(list 
					'(0 . "BLOCK")
					'(100 . "AcDbEntity")
					'(100 . "AcDbBlockBegin")
					'(8 . "0")
					(cons 2 nameBlock)
					(cons 10 pto-ins)
					(cons 70 (if atrib-var 2 0))
				)
	)
)


(defun makeBlockGMM (listaEntNames nameBlock pto-ins atrib-var / msg ciclo)
	
	(defun ciclo ( listaEntNames / X)
		(foreach X listaEntNames
				(entmake (entget X))
		)
	)
	
	(if (vl-catch-all-error-p (setq resultado01 (vl-catch-all-apply 'ent-block (list nameBlock pto-ins atrib-var)))) 
		(progn 
			(prompt (setq msg (strcat "**ERROR en Cabecera, mensage de error: " (vl-catch-all-error-message resultado01))))
		)
	)
	
	(if (and (not msg ) (vl-catch-all-error-p (setq resultado02 (vl-catch-all-apply 'ciclo (list listaEntNames)))))
		(progn 
			(prompt (setq msg (strcat "**ERROR en creacion de entidades, mensage de error: " (vl-catch-all-error-message resultado02))))
		)
	)
	
	(if (and (equal resultado1 nil) (equal resultado2 nil))
		(progn
			(ent-endblock)
		)
	)

)

(defun ent-endblock ( / )
	
	(entmake 	(list 
					'(0 . "ENDBLK")
					'(100 . "AcDbEntity")
					'(100 . "AcDbBlockEnd")
					'(8 . "0")
				)
	)
)

Regards.

Share this post


Link to post
Share on other sites
gerardo2m

 

Thanks Lee.

Problem solved with your advice.

Share this post


Link to post
Share on other sites
Lee Mac

Good stuff - you're welcome. :thumbsup:

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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