ocx

ocx

Anonymous
Not applicable
1,016 Views
16 Replies
Message 1 of 17

ocx

Anonymous
Not applicable
Is there any idea of how to get a block preview in VB/VBA automation?
I'm thinking; once AutoCAD has that small preview image in block definition
dialog box, there should be a way to get exact same functionality in VB/VBA
automation (or I'm wrong). In general I'm looking some ocx/dll ready
component for this purpose.
(I found out that ObjectDCL uses built in BlockView control. Where they
fount it?)
Sam
0 Likes
1,017 Views
16 Replies
Replies (16)
Message 2 of 17

Anonymous
Not applicable
One more think:
The same BlockView control used in ADT2i drawing/block preview pane.
Sam


"SSaarian" wrote in message
news:9A363ABC021BFD21EC9A08F91677C494@in.WebX.maYIadrTaRb...
> Is there any idea of how to get a block preview in VB/VBA automation?
> I'm thinking; once AutoCAD has that small preview image in block
definition
> dialog box, there should be a way to get exact same functionality in
VB/VBA
> automation (or I'm wrong). In general I'm looking some ocx/dll ready
> component for this purpose.
> (I found out that ObjectDCL uses built in BlockView control. Where they
> fount it?)
> Sam
>
>
0 Likes
Message 3 of 17

Anonymous
Not applicable
sam,

there is a command "_blockicon", but i found no other way than sendcommand to
run it.

- alfred -


In article ,
ssaarian@Meeks.com says...
> One more think:
> The same BlockView control used in ADT2i drawing/block preview pane.
> Sam
>
>
> "SSaarian" wrote in message
> news:9A363ABC021BFD21EC9A08F91677C494@in.WebX.maYIadrTaRb...
> > Is there any idea of how to get a block preview in VB/VBA automation?
> > I'm thinking; once AutoCAD has that small preview image in block
> definition
> > dialog box, there should be a way to get exact same functionality in
> VB/VBA
> > automation (or I'm wrong). In general I'm looking some ocx/dll ready
> > component for this purpose.
> > (I found out that ObjectDCL uses built in BlockView control. Where they
> > fount it?)
> > Sam
> >
> >
>
>
>
0 Likes
Message 4 of 17

Ed__Jobe
Mentor
Mentor
Right click on the vbaide toolbox and select Additional Controls. Check AcPriview.ocx.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 5 of 17

Anonymous
Not applicable
very interesting...
any sample code by any chance?
thanks

"Ed_Jobe" wrote in message news:f12b791.2@WebX.maYIadrTaRb...
> Right click on the vbaide toolbox and select Additional Controls. Check
AcPriview.ocx.
>
0 Likes
Message 6 of 17

Ed__Jobe
Mentor
Mentor
Not me personally. You might find some if you seach this ng for "AcPreview".

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 7 of 17

Anonymous
Not applicable
AcPreview1.Preview = "C:\Drawing1.dwg"

Now, anyone know why this doesn't work in VB6 or .NET?
0 Likes
Message 8 of 17

Anonymous
Not applicable
I was thinking about the block previews in "a" drawing
thanks

"kidcoach" wrote in message
news:f12b791.5@WebX.maYIadrTaRb...
> AcPreview1.Preview = "C:\Drawing1.dwg"
> Now, anyone know why this doesn't work in VB6 or .NET?
>
>
0 Likes
Message 9 of 17

Anonymous
Not applicable
According the knowledge base in the Autodesk developers section, the only way is to use blockicon with sendcommand (as Alfred stated above).

Link: http://pointasearch.autodesk.com/search97cgi/s97is.dll?action=View&VdkVgwKey=%2E%2E%5C%2E%2E%5C%2E%2E%5C%2E%2E%5Cinetpub%5Cwwwroot%5Ckdn%5Ccontent%5Csolutions%5C52697%2Ehtm&DocOffset=1&DocsFound=6&QueryZip=%28%5B%2E65535%5D+%28block+AND+preview%29++AND+%28PROD+%3CCONTAINS%3E+AUT%29%29&Collection=kdn&ScoreThreshold=0&&ViewTemplate=kdn%5Fview%2Ehts&showSummary=Show&DevURL=http%3A%2F%2Fpointa%2Eautodesk%2Ecom%2Flocal%2Fenu&PRODNAME=AutoCAD&PROD=AUT&APINAME=&API=&CATNAME=&CATS=&VisibleQueryText=block+preview&searchOptions=and
0 Likes
Message 10 of 17

Anonymous
Not applicable
thanks for your help, but
I was thinking of previewing the icons
in a acPreview image window in a form,
not creating them...
mark


"kidcoach" wrote in message
news:f12b791.7@WebX.maYIadrTaRb...
> According the knowledge base in the Autodesk developers section, the only
way is to use blockicon with sendcommand (as Alfred stated above).
> Link:
http://pointasearch.autodesk.com/search97cgi/s97is.dll?action=View&VdkVgwKey
=%2E%2E%5C%2E%2E%5C%2E%2E%5C%2E%2E%5Cinetpub%5Cwwwroot%5Ckdn%5Ccontent%5Csol
utions%5C52697%2Ehtm&DocOffset=1&DocsFound=6&QueryZip=%28%5B%2E65535%5D+%28b
lock+AND+preview%29++AND+%28PROD+%3CCONTAINS%3E+AUT%29%29&Collection=kdn&Sco
reThreshold=0&&ViewTemplate=kdn%5Fview%2Ehts&showSummary=Show&DevURL=http%3A
%2F%2Fpointa%2Eautodesk%2Ecom%2Flocal%2Fenu&PRODNAME=AutoCAD&PROD=AUT&APINAM
E=&API=&CATNAME=&CATS=&VisibleQueryText=block+preview&searchOptions=and
>
>
0 Likes
Message 11 of 17

Ed__Jobe
Mentor
Mentor
Notice that link specifies "creating" a preview image. The AcPreview control is for viewing them. You pass it the filename and the control takes care of reading the bitmap stored in the dwg file header. The BLOCKICON command is useful for dwgs that have a bunch of blocks in them for use with Design Center, creating a priview for each block. Merely saving a dwg creates the preview for a file.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 12 of 17

Anonymous
Not applicable
I found very useful
aced.com offered tools to preview drawing
and/or block bitmap image. <vlax.cls> and <ImageView.cls> do
everything.

The only problem I found was, that the
Vlisp object (used for retrieving dxf group code 310 chunks for saved bitmap
information) does work only in active(OPENED) drawing. So I couldn't get a
block image preview from CLOSED drawing. I'm trying to use ObjectDBX
to get entity data from CLOSED drawing, so far no success...

Thanks anyway to
aced.com guys and their supporters for
these VERY useful codes.

Sam


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Notice
that link specifies "creating" a preview image. The AcPreview control is for
viewing them. You pass it the filename and the control takes care of reading
the bitmap stored in the dwg file header. The BLOCKICON command is useful for
dwgs that have a bunch of blocks in them for use with Design Center, creating
a priview for each block. Merely saving a dwg creates the preview for a
file.
0 Likes
Message 13 of 17

Anonymous
Not applicable
READ aced.com
acadX.com

(spell check)

Sam


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I found very useful
aced.com offered tools to preview drawing
and/or block bitmap image. <vlax.cls> and <ImageView.cls> do
everything.

The only problem I found was, that the
Vlisp object (used for retrieving dxf group code 310 chunks for saved bitmap
information) does work only in active(OPENED) drawing. So I couldn't
get a block image preview from CLOSED drawing. I'm trying to
use ObjectDBX to get entity data from CLOSED drawing, so far no
success...

Thanks anyway to
aced.com guys and their supporters for
these VERY
useful codes.

Sam


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Notice
that link specifies "creating" a preview image. The AcPreview control is for
viewing them. You pass it the filename and the control takes care of reading
the bitmap stored in the dwg file header. The BLOCKICON command is useful
for dwgs that have a bunch of blocks in them for use with Design Center,
creating a priview for each block. Merely saving a dwg creates the preview
for a file.
0 Likes
Message 14 of 17

Anonymous
Not applicable
just looking for a sample code using acPreview
to display blockicons...
also, as "kidcoach" mentioned earlier,
how come it does not work in VB6?
thanks
mark


"SSaarian" wrote in message
news:03D25FA026F26C835ED6B0A7096D3C09@in.WebX.maYIadrTaRb...
> I found very useful aced.com offered tools to preview drawing and/or block
bitmap image. and do everything.
> The only problem I found was, that the Vlisp object (used for retrieving
dxf group code 310 chunks for saved bitmap information) does work only in
active(OPENED) drawing. So I couldn't get a block image preview from CLOSED
drawing. I'm trying to use ObjectDBX to get entity data from CLOSED drawing,
so far no success...
> Thanks anyway to aced.com guys and their supporters for these VERY useful
codes.
> Sam
> "Ed_Jobe" wrote in message news:f12b791.9@WebX.maYIadrTaRb...
> Notice that link specifies "creating" a preview image. The AcPreview
control is for viewing them. You pass it the filename and the control takes
care of reading the bitmap stored in the dwg file header. The BLOCKICON
command is useful for dwgs that have a bunch of blocks in them for use with
Design Center, creating a priview for each block. Merely saving a dwg
creates the preview for a file.
>
0 Likes
Message 15 of 17

Anonymous
Not applicable
> how come it does not work in VB6?
No one ever said it didn't work in VB6 or .NET. Read Ed's message
again...the control is for VIEWING not for CREATING previews. To VIEW
the preview, the file has to have been saved using 2000i or better. 2000
had an option to not save previews.

So, kidcoach's problem is either that he did not issue a .Refresh after
telling the control which file to preview, or he was accessing a pre-
2000i file, or had a blank drawing with no geometry which won't preview
either.

Look in this ng for "Help w/ Drawing Explorer ActiveX control" as I
posted sample code for using the control.

===============================
Mike Tuersley
PhD @ CADalyst's AutoCAD Clinic
http://www.cadonline.com
0 Likes
Message 16 of 17

Anonymous
Not applicable
thanks for your answer..
I would have liked a sample in acPreview,
and block icons.
DwgThumbnail works fine, it is the
acPreview which will not work in VB6,
although same code will work in VBA,
test it yourself and you will see...
mark


"Mike Tuersley" wrote in message
news:MPG.1862906b27d38c299896e9@discussion.autodesk.com...
> > how come it does not work in VB6?
> No one ever said it didn't work in VB6 or .NET. Read Ed's message
> again...the control is for VIEWING not for CREATING previews. To VIEW
> the preview, the file has to have been saved using 2000i or better. 2000
> had an option to not save previews.
>
> So, kidcoach's problem is either that he did not issue a .Refresh after
> telling the control which file to preview, or he was accessing a pre-
> 2000i file, or had a blank drawing with no geometry which won't preview
> either.
>
> Look in this ng for "Help w/ Drawing Explorer ActiveX control" as I
> posted sample code for using the control.
>
> ===============================
> Mike Tuersley
> PhD @ CADalyst's AutoCAD Clinic
> http://www.cadonline.com
0 Likes
Message 17 of 17

Anonymous
Not applicable
> DwgThumbnail works fine, it is the
> acPreview which will not work in VB6,
> although same code will work in VBA,
> test it yourself and you will see...
Awh! I hate whenever I do that!!! My apologies to you and kidcoach.
While I saw acPreview, I read DwgThumbNail. Sorry.

To answer your question, my understanding is that acPreview is
intertwined with AutoCAD's Today dialog box. So it stands to reason that
it requires acToday.arx to be loaded - which is why it works in vba but
not vb.

Regards,

Mike
===============================
Mike Tuersley
PhD @ CADalyst's AutoCAD Clinic
http://www.cadonline.com
0 Likes