Skip to content

Commit

Permalink
*запись файлов по отсутствующим путям
Browse files Browse the repository at this point in the history
  • Loading branch information
zamtmn committed Jan 5, 2025
1 parent 68c0572 commit 7df2993
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion cad_source/components/zebase/uzbpaths.pas
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ function GetPathsInDataPaths(const ASubFolder:String):String;

function GetWritableFilePath(const ASubFolder:String;const AFileName:String):String;
begin
result:=IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(GetAppConfigDir(false))+ASubFolder)+AFileName;
result:=IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(GetAppConfigDir(false))+ASubFolder);
ForceDirectories(result);
result:=result+AFileName;
end;

function GetPartOfPath(out part:String;var path:String;const separator:String):String;
Expand Down
22 changes: 12 additions & 10 deletions cad_source/zcad/commands/uzccommand_saveas.pas
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ function dwgSaveDXFDPAS(s:String;dwg:PTSimpleDrawing):Integer;
pu:ptunit;
allok:boolean;
begin
allok:=savedxf2000(s,ConcatPaths([GetRoCfgsPath,CFScomponentsDir,CFSemptydxfFile]),dwg^);
pu:=PTZCADDrawing(dwg).DWGUnits.findunit(GetSupportPaths,InterfaceTranslate,DrawingDeviceBaseUnitName);
mem.init(1024);
pu^.SavePasToMem(mem);
mem.SaveToFile(ChangeFileExt(expandpath(s),'.dbpas'));
mem.done;
if allok then
result:=cmd_ok
else
result:=cmd_error;
allok:=savedxf2000(s,ConcatPaths([GetRoCfgsPath,CFScomponentsDir,CFSemptydxfFile]),dwg^);
pu:=PTZCADDrawing(dwg).DWGUnits.findunit(GetSupportPaths,InterfaceTranslate,DrawingDeviceBaseUnitName);
if pu<>nil then begin
mem.init(1024);
pu^.SavePasToMem(mem);
mem.SaveToFile(ChangeFileExt(expandpath(s),'.dbpas'));
mem.done;
end;
if allok then
result:=cmd_ok
else
result:=cmd_error;
end;

function dwgQSave_com(dwg:PTSimpleDrawing):Integer;
Expand Down

0 comments on commit 7df2993

Please sign in to comment.