TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on January 15, 2019, 01:58:14 PM
-
Hi all,...
I've this code to get PDF with ODBX method.
(vlax-for i (vla-get-Layouts dbx)
(vlax-for Obj (vla-get-Block i)
(if (and
(not (member (vla-get-ObjectName obj) '("AcDbViewport")))
(= (vla-get-ObjectName Obj) "AcDbPdfReference")
(vlax-property-available-p Obj 'File)
(setq pdffile (findfile (vla-get-File Obj)))
)
(setq PdfList (append PdfList (list pdffile)))
)
)
)
it work,...but in some case,...it take very long to get the PDF list due the fact the..
(vla-get-count (vla-get-Block i)) = 19779
so I'm trying to found a workaround and accelerate the process...
any suggestion ?
Thank you.
-
doc
>> dictionaries
>> acad_pdfdefinitions
>> entry
>> cdr of second 330 group is the instance
And yes, you can get dxf data from dbx docs. Cheers.
-
Thank you guys,...
I'll give a try... :)
-
very succinct MP.
-
TX
-
Quick & dirty - should work but it's been a long day O.o ...
(defun _get-pdf-refs ( doc / temp )
(mapcar 'vlax-ename->vla-object
(apply 'append
(mapcar
'(lambda (x)
(mapcar 'cdr
(vl-remove-if-not
'(lambda (p)
(and
(eq 330 (car p))
(eq "PDFUNDERLAY" (cdr (assoc 0 (entget (cdr p)))))
)
)
(entget (vlax-vla-object->ename x))
)
)
)
(progn
(vl-catch-all-apply 'eval
'((vlax-for x
(vla-item (vla-get-dictionaries doc) "acad_pdfdefinitions")
(setq temp (cons x temp))
))
)
(reverse temp)
)
)
)
)
)
FWIW ... cheers.
-
should work ...
Did a quick test; works. Cheers.
-
(vl-catch-all-apply 'eval
'((vlax-for x
(vla-item (vla-get-dictionaries doc) "acad_pdfdefinitions")
(setq temp (cons x temp))
))
)
Neat alternative to (vl-catch-all-apply '(lambda ( ) (vlax-for ... ))) - I like it :-)
-
Thanks Lee. :)
-
Hi Guys,..
Thanks for the info,...
I'm trying to make test with DBX,..but entget can't be used..
so I still stuck with vla-for each images..
the code actually work,..but i'm trying to improve the speed execution..
any suggestion will be appreciated.
Thank you. :)
-
entget can't be used
Explain; I've used entget on dbx docs successfully longer than I've been a member here.
-
I think he's referring to this working for IMAGES too.
-
Images are just as easy but I'll refrain from posting anything until I understand where the goal posts are. Thanks Ron.