You can use the AsdkUnsupp2004.arx (has
been updated for 2004)
Below is an example in VBA.
Dim dialog As AsdkUNSUPP2004Lib.Application
LoadUnsupp
Set dialog =
Application.GetInterfaceObject("Asdkunsupp2004.Application.1")
'Displays Open dialog
Dim open_file As String
open_file =
dialog.ShowOpenDialog("Open this file", "C:\program files\Acad2004",
"dwg")
Application.Documents.Open open_file
'Displays Lineweight dialog
aclw =
dialog.ShowLineWeightDialog(acLnWt040,
0)
ThisDrawing.Layers.Item("0").Lineweight = aclw
'Displays Linetype dialog
Dim ltype As AcadLineType
Dim aclt As
AcadLineType
ThisDrawing.Linetypes.Load "Hidden", "acad.lin"
Set ltype =
ThisDrawing.Linetypes.Item("Hidden")
Set aclt =
dialog.ShowLinetypeDialog(ltype, 0)
ThisDrawing.Layers.Item("0").Linetype =
aclt.Name
'Displays Hatch patterns dialog
Dim ocir(0) As AcadCircle
Dim cp(0 To
2) As Double
Dim rad As Double
Dim hpattern As String
Dim ohatch As
AcadHatch
cp(0) = 5
cp(1) = 5
cp(2) = 0
rad = 4
Set ocir(0) =
ThisDrawing.ModelSpace.AddCircle(cp, rad)
ocir(0).Update
hpattern =
dialog.ShowHatchPalletteDialog("ANSI31", 0)
Set ohatch =
ThisDrawing.ModelSpace.AddHatch(acHatchPatternTypePreDefined, hpattern,
True)
ohatch.AppendOuterLoop ocir
ohatch.Evaluate
'Displays Color dialog
Dim clr As Long
clr =
dialog.ShowColorDialog(acGreen, 1)
ohatch.Color = clr
'Displays the current shademode as a integer
ThisDrawing.SendCommand
"shademode G "
MsgBox dialog.ShadeMode
'Displays Save file dialog
Dim save_file As String
save_file =
dialog.ShowSaveDialog("Save this file as", "temp", "dwg")
ThisDrawing.SaveAs
save_file
Save
--
Saludos, Ing. Jorge Jimenez,
SICAD S.A., Costa Rica
> Hi
folks,
> Are the AutoCAD Color, Lineweight and Linetype dialogs available
from VBA?
> Sure be nice to find this!
>
> Thanks
>
Serge
>
>