Friday, December 1, 2023
Home3D ModelingError in Mannequin.import perform for dae file in SketchUp2023 - Ruby API

Error in Mannequin.import perform for dae file in SketchUp2023 – Ruby API


Hello all,

I’m utilizing SketchUp custom-made with Ruby.
In your Ruby program,

choices = {
:validate_dae => true,
:merge_coplanar_faces => true,
:show_summary => true
}
Sketchup.active_model.import(fileName, choices)
and name.
I attempted to learn a .dae file with this code.

If this course of is executed with SketchUp2023 for mac model(v23.0.396), it is going to finish with an error.

It labored with out issues in SketchUp2023/Win model.
As well as, It labored with out issues in SketchUp2022/Mac or Win model.

If this .dae file is imported from SketchUp2023 Mac’s File menu,
it imports fantastic.

Is that this a programming subject or an API subject?
Please let me know if anybody is aware of the answer.

Thanks very a lot.

export_out.dae (240.9 KB)


Please attempt to put up your code in line with this:


What error?

Message is fail to import (in Japanese) by dialog.
Additionally, the perform returns false.

The code is like beneath.

def import_dae()
	filePath = "/tmp/export_out.dae"
	
	choices = {
		:validate_dae => true,
		:merge_coplanar_faces => true,
		:show_summary => true
	}
	res = Sketchup.active_model.import(filePath, choices)
	places("import outcome=#{res}")
finish



1 Like

I do not see drawback with the code itself…The one factor I can counsel to outline a full path for the filePath (?)

Sadly I can’t check – no expertise – on Mac, the .dae file itself seems good too…

Further Data

I had no issues with SketchUp2023/mac on my M1 MacBook Air.
An error happens solely with SketchUp2023/mac on Intel Mac mini.

Attempt altering a number of the choices …

def import_dae(caption = 'Import Collada (DAE)')
  win = Sketchup.platform == :platform_win
  ext =( win ? 'Collada Information|*.dae||' : '*.dae' )
  file_path = UI.openpanel("#{caption} ...", Sketchup.temp_dir, ext)
  return except file_path
  choices = {
    :validate_dae => true,
    :merge_coplanar_faces => true,
    :show_summary => true
  }
  title="Import Choices"
  prompts  = ['Validate Dae','Merge Coplanar Faces','Show Summary']
  defaults = [
    options[:validate_dae],
    choices[:merge_coplanar_faces],
    choices[:show_summary]
  ]
  decisions  = Array.new(choices.dimension, 'true|false')
  opts = UI.inputbox(prompts, defaults, decisions, title)
  return except opts
  choices[:validate_dae]= opts[0]
  choices[:merge_coplanar_faces]= opts[1]
  choices[:show_summary]= opts[2]
  res = Sketchup.active_model.import(file_path, choices)
  places("DAE import outcome: #{res}")
finish

NOTE: The DAE import abstract dialog shouldn’t be working accurately.
It flashes on the display screen so quick it can’t be learn.

I did a check.
The next combos are executed, and “Import failed” is displayed for all.

the that means of the quantity
(1) Validate Dae, (2) Merge Coplanar, (3) Present Abstract
and

check mixture
(1) true, (2) true, (3) true => fail
(1) false, (2) true, (3) true => fail
(1) true, (2) false, (3) true => fail
(1) true, (2) true, (3) false => fail
(1) false, (2) false, (3) true => fail
(1) true, (2) false, (3) false => fail
(1) false, (2) true, (3) false => fail
(1) false, (2) false, (3) false => fail

thanks.

Okay please file a API subject within the tracker. Make sure you be aware the model and that it’s a Mac silicon solely subject.

I acquired it
I’ll apply for a tracker.
thanks.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments