Jump to content

Recommended Posts

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

Posted

 

Thanks Lee.

Problem solved with your advice.

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