3dwannab Posted July 7, 2023 Posted July 7, 2023 (edited) Fixed it with a hammer method with this below. Which is probably not what a real programmer would do. ;; isPropMissing ;; Written by 3dwannab, 2023.07.07 ;; Test your props, props to you (defun isPropMissing (e p /) (vl-catch-all-error-p (vl-catch-all-apply (function (lambda () (vlax-get-property e p) ) ;_ end of lambda ) ;_ end of function ) ;_ end of vl-catch-all-apply ) ) (setq e (car (entsel "Pick me, pick me!\n"))) (setq e (vlax-ename->vla-object e)) ;; Doesn't seem to like the gradient properties of some hatches ;; So set up two different hatchPropLists (setq hatchPropListsWithTrans '(associativehatch backgroundcolor elevation entitytransparency gradientangle gradientcentered gradientcolor1 gradientcolor2 gradientname hatchobjecttype hatchstyle isopenwidth layer linetype linetypescale lineweight material origin patternangle patterndouble patternscale patternspace plotstylename truecolor visible)) (setq hatchPropListsWithoutTrans '(associativehatch backgroundcolor elevation entitytransparency gradientangle hatchobjecttype hatchstyle isopenwidth layer linetype linetypescale lineweight material origin patternangle patterndouble patternscale patternspace plotstylename truecolor visible)) ;; Based on whether there's transparency or not it gets a list of the hatches properties (if (isPropMissing e "gradientcolour2") (setq a (mapcar '(lambda (x) (list x (vlax-get e x))) hatchPropListsWithoutTrans)) (setq a (mapcar '(lambda (x) (list x (vlax-get e x))) hatchPropListsWithTrans)) ) (princ a) (princ "\n") (princ "Prop Missing? ") (princ (isPropMissing e " gradientcolour2 ")) (setq a nil) (setq e nil) (setq hatchPropListsWithoutTrans nil) (setq hatchPropListsWithTrans nil) Edited July 7, 2023 by 3dwannab Quote
Recommended Posts
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.