• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Open DXF file in Illustrator without dialog box

New Here ,
May 17, 2021 May 17, 2021

Copy link to clipboard

Copied

Hello everyone, 

 

I´ll try to open a dxf-file from a specific folder (dxf_pfad: described in the global variables) with a specific name (alte_bezeichnung: also described as a global variable) with some standard import options. 

I worked with this solved code from the past: Solved: Open DXF file in Illustrator without dialog box - Adobe Support Community - 10324250 but I end up with an ERROR 8700. 

Below you can find my code. Hopefully someone from you can help me. 

 

Thanks in advance. 😃

Greetings

function openDXF(){
	var dxf = dxf_pfad + alte_Bezeichnung + '.dxf';	
	app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
	var options = getOptions();
	var dxf_file = app.open(File(dxf), DocumentColorSpace.CMYK);
	app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
};
function getOptions() {
		var importOptions = app.preferences.AutoCADFileOptions;
		importOptions.centerArtwork = true;
		optRef.selectedLayoutName="Model";
		importOptions.globalScaleOption = AutoCADGlobalScaleOption.FitArtBoard;
		return importOptions;
};

 

TOPICS
Scripting

Views

309

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , May 17, 2021 May 17, 2021

Hello,

 

this one can be clarified as solved. Took me one and half day to solve it and it was so simple...

I thought the error could be somewhere else and deleted the displayalert-coding to see if there is something wrong with the dxf. Et voilá - it works now... 

function openDXF(){
	var dxf = dxf_pfad + alte_Bezeichnung + '.dxf';	
	var options = getOptions();
	var dxf_file = app.open(File(dxf), DocumentColorSpace.CMYK);
};
function getOptions() {
	var importOptions = app.preferences.AutoCADFileOpti
...

Votes

Translate

Translate
Adobe
New Here ,
May 17, 2021 May 17, 2021

Copy link to clipboard

Copied

LATEST

Hello,

 

this one can be clarified as solved. Took me one and half day to solve it and it was so simple...

I thought the error could be somewhere else and deleted the displayalert-coding to see if there is something wrong with the dxf. Et voilá - it works now... 

function openDXF(){
	var dxf = dxf_pfad + alte_Bezeichnung + '.dxf';	
	var options = getOptions();
	var dxf_file = app.open(File(dxf), DocumentColorSpace.CMYK);
};
function getOptions() {
	var importOptions = app.preferences.AutoCADFileOptions;
	importOptions.centerArtwork = true;
	optRef.selectedLayoutName="Model";
	importOptions.globalScaleOption = AutoCADGlobalScaleOption.FitArtBoard;
	return importOptions;
};

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines