Hello all, I'm having difficulties selecting a 3DSolid in autocad using delphi 5 VBA source works fine: Dim returnobj As AcadObject Dim basePnt As Variant Public backbone As Acad3DSolid ..... ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select backbone." Set backbone = returnobj ..... However in Delphi: Util: AcadUtility; ac_Obj: AcadObject; PickedPoint: OleVariant; ..... Util:= AcadApp.ActiveDocument.Utility; ..... Util.GetEntity(ac_Obj,PickedPoint,'Select the Backbone'); <-- line with error ..... I get the (compiler) error: Types of actual and formal var parameters must be identical The cursor blinks just after the first comma Thanks!
[pre] Util: AcadUtility; ReturnedObj: IDispatch; ac_Obj: AcadEntity PickedPoint: OleVariant; .... Util:= AcadApp.ActiveDocument.Utility; .... Util.GetEntity(ReturnedObj,PickedPoint,'S elect the Backbone'); ac_Obj := ReturnedObj as AcadEntity; .... [/pre]
Thanks Jackrabbit! Works just fine. Another issue... Is this the way to get a 3DSolid from a BlockReference? Especialy the IDispatch part! Count: integer; ac_ExplObjects: OleVariant; ... ac_ExplObjects:=ac_BlockRef.Explode; for count:=VarArrayLowBound(ac_ExplObjects,1) to VarArrayHighBound(ac_ExplObjects,1) do begin if ac_ExplObjects[count].Layer='WELD_CLEARANCE_150' then ac_3DS_Clearance150 := IDispatch(ac_ExplObjects[tel]) as IAcad3DSolid else begin ... ac_ExplObjects[count].Delete; ... End; End; ac_3DS_Clearance150 := IDispatch(ac_ExplObjects[tel]) as IAcad3DSolid Greetz, Jack