Message 1 of 6
Does a block exist with Delphi
Not applicable
01-21-2002
01:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using Delphi to try and find if a block exists in a drawing. The Logic
should be the same as VBA however, I think I'm missing something really
minor. What type of argument do I supply for the ThisDrawing.Blocks(?)
My code is:
var
blockRefObj : IAcadBlockReference;
sBlkName : widestring;
sACADPath : string;
begin
sACADPath := dtmGAFloatingOptions.appAcadApp.Path;//Path to AutoCAD
sBlkName := sACADPath+'\PREVRDGS.dwg';//Name of block to insert.
if blockRefObj =
dtmGAFloatingOptions.appAcadApp.ActiveDocument.Blocks(sBlkName) then
Showmessage ('Block exists');
end;
should be the same as VBA however, I think I'm missing something really
minor. What type of argument do I supply for the ThisDrawing.Blocks(?)
My code is:
var
blockRefObj : IAcadBlockReference;
sBlkName : widestring;
sACADPath : string;
begin
sACADPath := dtmGAFloatingOptions.appAcadApp.Path;//Path to AutoCAD
sBlkName := sACADPath+'\PREVRDGS.dwg';//Name of block to insert.
if blockRefObj =
dtmGAFloatingOptions.appAcadApp.ActiveDocument.Blocks(sBlkName) then
Showmessage ('Block exists');
end;