Leaderboard
Popular Content
Showing content with the highest reputation on 08/28/2018 in all areas
-
A few minutes ago, I tried to drag & drop a *.png image to a thread response. The result was that my image appeared to open in a web based image viewer, and the "window" I was in had no forum navigation controls except the back arrow on the header, which would only take me back to my unread topics list. And that wiped out the post I was going to make completely. I will try and duplicate the error here. I will copy this message and paste it in a new post if the error occurs and add further info if there is any. Here goes... OK, I figured out how it happens. If you drop the image file anywhere else other than the drop "box" while it is highlighted and wrapped in a dashed line. the image opens in a new window with the LOCAL file name as the web address. If one is careful and doesn't get lost in the fog of "How in the @#$% did this happen?", one can get back to the postable message by closing the extra window before hitting anything else. Is the cause simply that I am too old and befuddled to do this computer stuff any more? More edit. Oh my. It is me. The image opens in a viewer when dragged to ANY webpage and dropped in empty space. I have been using computers since 1982 and have never even done this action one time before. I didn't even know it would happen. Can someone bring me some hot cocoa and a blankie? I'll be here in my rocking chair by the fireplace.3 points
-
2 points
-
Let's see if we can pimp that one Hi Stefan! Very clever piece of coding there! I'm not sure if the version loody attached is your latest version, but I noticed that the 1rst line makes the 2nd line bomb. (*acDoc* is define on the 1rst line while the 2nd uses an undefined variable acDoc). Now, lets see what I can do with it with some matrix functions kindly made available by Vladimir Nesterovsky, Doug Wilson and Gile... (Merci Gilles. Tu es un mentor et une source d'inspiration même à une distance de probablement plusieurs fuseaux horaires!) Not bad, heh? Soooo! If 14$ is too expensive, tell us how much you think would be a fair price? (ie not too expensive....). I'm wondering how much our time is worth to someone who will get the credit for an increased productivity. At least a "like" I hope. Enjoy (defun dupfromins (ent parentlst / tmpnam tmplst newitm); duplst and ss as global here, local to c:ecl ;ent is insert ;(eq "INSERT" (cdr (assoc 0 (entget ent)))) ;Jef! 2018-08-28 (if (null parentlst) (setq parentlst (cons ent parentlst))) (setq ent (tblobjname "block" (cdr (assoc 2 (entget ent))))) (while (setq ent (entnext ent)) (cond ((member (setq tmpnam (cdr(assoc 0 (setq tmplst (entget ent))))) '("LINE" "LWPOLYLINE" "ARC" "CIRCLE")) (vla-transformby (vlax-ename->vla-object (setq newitm (entmakex (append (vl-remove-if '(lambda (x) (member (car x) '(-1 330 5))) tmplst) (list (cons 410(getvar 'ctab)))) ) ) ) (vlax-tmatrix (get-tmatrix parentlst)) ) ;(setq duplst (cons (vlax-ename->vla-object newitm) duplst)) (setq duplst (cons newitm duplst)) (ssadd newitm ss) ) ((eq "INSERT" tmpnam) (dupfromins ent (cons ent parentlst)) ) ) ) ) ;;;;;;;; ;helper functions to the helper function ^^ ;; Get-TMatrix (gile) ;; Retourne une matrice de transformation (4X4) identique à celle retournée par nentselp ;; ;; Argument ;; lst : (liste de ENAME) la liste des entités "parents" de la plus imbriqué à celle ;; insérée dans l'espace courant -indentique à (last (nentsel)) ou (last (nentselp)) (defun get-tmatrix (lst / mat pt geom) (setq mat (Imat 3) pt '(0.0 0.0 0.0) ) (while lst (setq geom (refgeom (car lst)) mat (mxm (car geom) mat) pt (mapcar '+ (mxv (car geom) pt) (cadr geom)) lst (cdr lst) ) ) (append (mapcar '(lambda (v x) (append v (list x))) mat pt) (list '(0.0 0.0 0.0 1.0)) ) ) ;; IMAT ;; Crée une matrice d'identité de dimension n ;; ;; Argument ;; n : la dimension de la matrice (defun Imat (d / i n r m) (setq i d) (while (<= 0 (setq i (1- i))) (setq n d r nil) (while (<= 0 (setq n (1- n))) (setq r (cons (if (= i n) 1.0 0.0) r)) ) (setq m (cons r m)) ) ) ;; Apply a transformation matrix to a vector by Vladimir Nesterovsky ;; Arguments: a 3X3 matrix and a vector ;; Return : the vecor transformed by the matrix (defun mxv (m v) (mapcar '(lambda (r) (apply '+ (mapcar '* r v))) m) ) ;; TRP ;; transpose une matrice -Doug Wilson- ;; ;; Argument : une matrice (defun trp (m) (apply 'mapcar (cons 'list m))) ;; MXM ;; Multiple (combine) deux matrices -Vladimir Nesterovsky- ;; ;; Arguments : deux matrices (defun mxm (m q) (mapcar '(lambda (r) (mxv (trp q) r)) m) ) ;; RefGeom (gile) ;; Retourne une liste dont le premier élément est une matrice de transformation ;; (rotation, échelles, normale) de dimension 3X3 et le second le point ;; d'insertion de l'objet dans son "parent" (xref, bloc ou espace) (defun RefGeom (ename / elst ang norm mat) (setq elst (entget ename) ang (cdr (assoc 50 elst)) norm (cdr (assoc 210 elst)) ) (list (setq mat (mxm (mapcar (function (lambda (v) (trans v 0 norm T))) '((1.0 0.0 0.0) (0.0 1.0 0.0) (0.0 0.0 1.0)) ) (mxm (list (list (cos ang) (- (sin ang)) 0.0) (list (sin ang) (cos ang) 0.0) '(0.0 0.0 1.0) ) (list (list (cdr (assoc 41 elst)) 0.0 0.0) (list 0.0 (cdr (assoc 42 elst)) 0.0) (list 0.0 0.0 (cdr (assoc 43 elst))) ) ) ) ) (mapcar '- (trans (cdr (assoc 10 elst)) norm 0) (mxv mat (cdr (assoc 10 (tblsearch "BLOCK" (cdr (assoc 2 elst))))) ) ) ) ) ;;;;;;;;;;;;;; ;main function (defun c:ECL ( / *error* i lst ms r1 reg ss sysvar prop duplst) ;modified by Jef! on 2018-08-28 to also work with blocks ;warning: doesnt verify if block inserts are uniformaly scaled ;but who uses non uniformaly scaled blocks anyway? :) (or acDoc (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))) (setq ms (vlax-get acDoc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))) (vla-startundomark acDoc) (setq pa (getvar 'peditaccept) dr (getvar 'draworderctl) ce (getvar 'cmdecho) aa 0.00 ) (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*EXIT*")) (princ (strcat "\nError: " msg)) ) (foreach x segments (vla-delete x)) (setvar 'peditaccept pa) (setvar 'draworderctl dr) (setvar 'cmdecho ce) (vla-endundomark acDoc) (princ) ) (defun l2p (l) (if l (cons (list (car l) (cadr l) (caddr l)) (l2p (cdddr l))))) (defun break_object (e points / object_type start center end radius normal arc res) (if points (progn (setq points (vl-sort points (function (lambda (a b) (< (vlax-curve-getdistatpoint e a) (vlax-curve-getdistatpoint e b) ) ) ) ) ) (cond ((eq (setq object_type (vla-get-ObjectName e)) "AcDbLine") (setq start (vlax-curve-getstartpoint e)) (while points (if (> (distance start (car points)) 1e-8) (setq res (cons (vlax-invoke ms 'addline start (setq start (car points))) res)) ) (setq points (cdr points)) ) ) (T (if (eq object_type "AcDbArc") (setq start (vlax-curve-getStartParam e)) (setq start (vlax-curve-getparamatpoint e (car points)) points (reverse (cons (car points) (reverse (cdr points)))) ) ) (setq center (vla-get-Center e) radius (vla-get-Radius e) normal (vla-get-Normal e) ) (while points (if (not (equal start (setq end (vlax-curve-getparamatpoint e (car points))) 1e-8)) (progn (setq arc (vla-AddArc ms center radius start end)) (vla-put-Normal arc normal) (setq res (cons arc res)) ) ) (setq points (cdr points) start end) ) ) ) ) ) res ) (if (setq ss (ssget ":L" '((0 . "LINE,LWPOLYLINE,ARC,CIRCLE,INSERT"))));added insert (Jef!) (progn (repeat (setq i (sslength ss));added by Jef! (setq i (1- i) e (ssname ss i) ) (if (eq "INSERT" (cdr (assoc 0 (entget e)))) (progn (dupfromins e nil) (ssdel e ss) ) ) );end added by Jef! (repeat (setq i (sslength ss)) (setq i (1- i) e (ssname ss i) e (vlax-ename->vla-object e) ) (if (eq (vla-get-ObjectName e) "AcDbPolyline") (foreach x (vlax-invoke e 'Explode) (setq lst (cons x lst)) ) (setq lst (cons (vla-copy e) lst)) ) ) (if (setq segments (apply 'append (mapcar (function (lambda (e / l) (break_object e (progn (foreach other (vl-remove e lst) (foreach x (l2p (vlax-invoke e 'intersectwith other acExtendNone)) (setq l (cons x l)) ) ) (if (eq (vla-get-ObjectName e) "AcDbCircle") l (cons (vlax-curve-getendpoint e) l) ) ) ) ) ) lst ) ) ) (progn (setq reg (vlax-invoke ms 'AddRegion segments)) (foreach x (append segments lst) (vla-delete x)) (setvar 'peditaccept 1) (setvar 'draworderctl 0) (setvar 'cmdecho 0) (foreach x reg (setq x (vlax-vla-object->ename x)) (command "_explode" x) (command "_pedit" "_m" "_p" "" "_j" "" "") (if (> (vlax-curve-getArea (entlast)) aa) (setq aa (vlax-curve-getArea (setq ea (entlast))))) ) (if (> (length reg) 1) (entdel ea)) (if duplst (mapcar 'entdel duplst));added by Jef! (setvar 'peditaccept pa) (setvar 'draworderctl dr) (setvar 'cmdecho ce) ) (princ "\nValid region(s) not found") ) ) ) (vla-endundomark acDoc) (princ) ) Cheers!1 point
-
The first image I pasted, a jpg, was compressed from 177 kb to 69.37 kb. Not sure what the point of that is. I don't want to assume every image type gets hit with about the same 40% +- ratio because there'd be nothing left of a tif or png at that level of degradation. I suppose it makes the 9.77 mg max limit last a little longer. I guess we'll have to clean house a little more often. IMO the jpg is by far the clearer of the two images I did paste up here though.1 point
-
I think we've all been there at one time or another. I know I've been there a time or two, or three.1 point
-
For the purpose of printing, you definitely want to save as tif format, no doubt. But for the web, png or jpg is a better option. When I had my website, I tried putting tif images of my renders on it, but the large file size's caused the pages to load very slowly. When I switched to png, the images were still good quality and the pages loaded much faster.1 point
-
1 point
-
1 point
-
1 point