Hello,
Added all suggested changes and upload a 1.01 zip to the link above.
Thanks again to Dan for the advises and code samples. Learned a lot.
Hans-Peter
Hello,
Added all suggested changes and upload a 1.01 zip to the link above.
Thanks again to Dan for the advises and code samples. Learned a lot.
Hans-Peter
Hello Dan,
Thanks again.
I will add this at the evening.
One question again: Is there a save way to gets sketchup's main window handle.
I see some posts with winApi calls to search the window by title string.
I have done the same in my Dll.
Would be nice when Sketchup would publish this in a global var.
Hans-Peter
I think I have now the correct format but it still does not work.
"pdScript interpreter"="pdScript interpreter";
"Adds pdScript interpreter to the ruby environment"="Adds pdScript interpreter to the ruby environment!";
"pdScript"="pdScript English";
"Start pdScript clock Dialog"="Start pdScript clock Dialog English";
"Start pdScript MyDialog Dialog modal"="Start pdScript MyDialog Dialog modal English";
"Start pdScript MyDialog Dialog non-modal"="Start pdScript MyDialog Dialog non-modal English";
"Start pdScript FreeScript"="Start pdScript FreeScript English";
@@lang = parse_langfile(langpath) # create the language hash
UI.messagebox(@@lang["pdScript interpreter"])
does show an empty dialog.
Hans-Peter
Hello Dan,
Thanks again for the advises and samples.
I did what you say, but since you did not post the file format for the language file I tried to understand the source of the parse-function.
My pdScript_menu.en is this:
pdScript interpreter="pdScript interpreter"
Adds pdScript interpreter to the ruby environment="Adds pdScript interpreter to the ruby environment!"
pdScript="pdScript English"
Start pdScript clock Dialog="Start pdScript clock Dialog English"
Start pdScript MyDialog Dialog modal="Start pdScript MyDialog Dialog modal English"
Start pdScript MyDialog Dialog non-modal="Start pdScript MyDialog Dialog non-modal English"
Start pdScript FreeScript="Start pdScript FreeScript English"
The function runs but I get always the key instead of the value.
What did I miss?
Regards
Hans-Peter
Hello Dan,
Thanks for the suggestions.
I will remove the Win32API from the zip.
I had a look to module as you advised.
Here my frist attempt:
require 'sketchup.rb'
module PdScript
if not file_loaded?(File.basename(__FILE__))
# UI.messagebox("pdScript loader startet")
win32api_file = Sketchup.find_support_file "Plugins/Win32API.so", ""
pdScriptapi_file = Sketchup.find_support_file "Plugins/pdScript/pdScriptE.dll", ""
# UI.messagebox("pdScriptDll="+pdScriptapi_file)
if (win32api_file)
require 'Win32API'
# UI.messagebox("Win32API loaded ")
if File.exist? pdScriptapi_file
@pdScript = Win32API.new(pdScriptapi_file, "pdScriptA", ['P','P','L'], 'I')
@pdsFreeScript = Win32API.new(pdScriptapi_file, "pdsFreeScript", ['I'], 'I')
@pdsExecuteFunction = Win32API.new(pdScriptapi_file, "pdsExecuteFunctionA", ['I','P','P','P'], 'I')
@pdScriptScriptHandle = 0
# puts "psScript_Result; "
# puts @pdScript
dll_file = Sketchup.find_support_file "Plugins/pdScript/RubyConnect.dll", ""
if (dll_file)
@FindConnectedWindow = Win32API.new(dll_file, "FindConnectedWindow", ['P','P'], 'P')
# UI.messagebox("FindConnectedWindow loaded")
FindConnectedWindowSU = @FindConnectedWindow.Call("- SketchUp","")
# UI.messagebox("Return from FindConnectedWindow; "+FindConnectedWindowSU)
# else
# UI.messagebox("File RubyConnect.dll is missing in the pdScript-Plugins! pdScript loading fails!")
end # if
# UI.messagebox("pdScript loaded")
add_separator_to_menu("Plugins")
$pdScriptMenuStrings = LanguageHandler.new("pdScript_menu.strings")
pdScript_menu = UI.menu("Plugins").add_submenu($pdScriptMenuStrings.GetString("pdScript"))
pdScript_menu.add_item($pdScriptMenuStrings.GetString("Start pdScript clock Dialog")) { PdScript.start_clock_dialog }
pdScript_menu.add_item($pdScriptMenuStrings.GetString("Start pdScript MyDialog Dialog modal")) { PdScript.start_mydialog_dialog }
pdScript_menu.add_item($pdScriptMenuStrings.GetString("Start pdScript MyDialog Dialog non-modal")) { PdScript.start_mydialog_nonmodal_dialog }
pdScript_menu.add_item($pdScriptMenuStrings.GetString("Start pdScript FreeScript")) { PdScript.start_freescript }
else
UI.messagebox("Cannot find file pdScriptE.dll!")
end # if
else
UI.messagebox("File Win32API.so is missing in the SketchUp-Plugins-Directory! pdScript loading fails!")
end # if
else
puts "File "+File.basename(__FILE__)+" was yet loaded!"
end # if
def PdScript.start_clock_dialog
# UI.messagebox("Before clock Dialog")
pdScriptclock_file = Sketchup.find_support_file "Plugins/pdScript/Clock.dpas", ""
retval = @pdScript.Call(pdScriptclock_file,"",0)
UI.messagebox("Return from Clock-Dialog; "+retval.to_s())
end
def PdScript.start_mydialog_dialog
# UI.messagebox("Before clock Dialog")
pdScriptMyDialog_file = Sketchup.find_support_file "Plugins/pdScript/MyDialog.dpas", ""
retval = @pdScript.Call(pdScriptMyDialog_file,"/pds{hide-from-taskbar=true}",0)
UI.messagebox("Return from Modal-Dialog; "+retval.to_s())
end
def PdScript.start_mydialog_nonmodal_dialog
# UI.messagebox("Before clock Dialog")
pdScriptMyDialog_file = Sketchup.find_support_file "Plugins/pdScript/MyDialogNon.dpas", ""
@pdScriptScriptHandle = @pdScript.Call(pdScriptMyDialog_file,"/pds{hide-from-taskbar=true;keep-alive=true;host-app="+FindConnectedWindowSU+"}",0)
# UI.messagebox("Return from NonModal-Dialog; "+@pdScriptScriptHandle.to_s())
end
def PdScript.start_freescript
# UI.messagebox("Before clock Dialog")
if @pdScriptScriptHandle > 0
retval = @pdsFreeScript.Call(@pdScriptScriptHandle)
@pdScriptScriptHandle = 0
end
# UI.messagebox("Return from Freescript: "+retval.to_s())
end
def PdScript.ExecuteFunction(param1, param2, param3)
# UI.messagebox("Before ExecuteFunction")
retval = @pdsExecuteFunction.Call(@pdScriptScriptHandle, param1, param2, param3)
UI.messagebox("Return from ExecuteFunction; "+retval.to_s())
end
file_loaded(File.basename(__FILE__))
# Sample calls from RubyConsole to comunicate to open pdScriptdialog
# PdScript.ExecuteFunction("ChangeEdit2","Value 2 from RubyCall","|")
# PdScript.ExecuteFunction("ChangeEdit4","Value 4 from RubyCall","|")
# PdScript.ExecuteFunction("ChangeEdits","Value 1 from RubyCall|Value 2 from RubyCall|Value 3 from RubyCall|Value 4 from RubyCall","|")
end
Seems to work.
Is that the proper way to use a modul?
Since my main-programming language is not ruby, it was my intention for posting here to hear from the experts, if I am doing something wrong.
Regards
Hans-Peter
Hello,
Some times ago I ran across a pascal script scripting language from Precision.
Whats it makes special was the fact that it supports GUI scripting.
http://www.be-precision.com/products/pdScript/
After they build an optional engine as a DLL, its get interesting to call it from other enviroments.
Similar to my newLISP integration into Sketchup, I build a pdScript extension for Sketchup.
newLISP: http://forums.sketchucation.com/viewtopic.php?f=180&t=18127&p=148708
A screenshot:
http://www.hpwsoft.de/SU_PDS.png
Windows only!
Interested who want to try it can download here:
http://www.hpwsoft.de/anmeldung/html1/sketchup/sketchup3.html
The ZIP contains 1 file at the toplevel:
pdScript_ext.rb
The rb is the extension which must be activated in the preferences.
The subfolder contains the DLL's and samples. Preserve the folder when you unpack the ZIP.
The extension adds a menu to the plugins menu with some demo.
The Win32API extension is needed from here:
http://forums.sketchucation.com/viewtopic.php?f=323&t=42732#p380121
Regards
Hans-Peter
Hello,
Does any of the known 3D PDF Solutions support Sketchup's dynamic components and their properties/values.
The adobe reader with open treeview has 2 windows below the tree.
The first shows the named views/cameras and the second shows 2 columns with propertyname and value (when a part in treeview is selected)
So I want to see skethup's properties/values appear there.
Any solution available?
Regards,
Hans-Peter
Hello,
That would be a nice feature to add.
I agree, getting the same structure in the PDF as is Sketchup would be very nice.
If you add tis, make it optional, to allow people who have other interests to use it in the current way.
Adding property/value to each node/component would transport the complete information available.
Regards
Hans-Peter
Hello,
Does the RPS 3D PDF Export-Plugin supports Dynamic Components ?
I do not mean that I will get the 3D model.
My questions:
Does the node names of the dynamic components as they show up in the SU outliner window show up in the adobe reader modell-tree window exactly in the same way?
Does the property/value pairs from SU 'Component Options' dialog appear in the bottom window of the adobe reader modell-tree window when clicking on the node in the tree?
I mean like in this adobe sample file:
http://www.adobe.com/manufacturing/3dpdfsamples/pdfs/aquo_bottle_version_v1_v2.pdf
Regards
Hans-Peter
Mit dem Reader X geht es, ist aber seltsam das es mit dem 9.4 nicht geht.
Andere 3D PDF hat der immer auch angezeigt.
Schade das Meshlab derzeit keine Farbe/Texture unterstützt.
Sonst wäre das eine interessante Software.
Da sind die kommerziellen Plugins dann doch noch besser.
Wenn ich auf die Demo-PDF klicke wird die PDF geöffnet und ich bekommen eine Fehlermeldung:
Beim Analysieren der 3D-Daten ist ein Fehler aufgetreten.
Und ich bekomme keine 3D-Ansicht.
Reader Version 9.4.2 auf IE 8.
Wie wäre es mit einem Export nach 3DPDF.
Dann braucht man nur einen Adobe Reader.
Da gibt es ja diese 2 Plugins:
http://www.renderplus.com/wk/Products_w.htm#RPS_3D_PDF_-_Interactive_3D_PDFs
http://www.simlab-soft.com/3d-plugins/3D-PDF-from-sketchup-main.aspx
I would think about 2 options:
Use a autolisp-routine to rename the autocad-block to include the wanted ATTDEF-info in the blockname.
Then a ruby can parse the component-definition-name and store it where you want.
Use a autolisp-routine to write some ruby's on the fly which does reference the block-name and store the wanted data back to the components.
When it is possible to write a small ruby to draw text in SU, then it should be a easy to make a autolisp-utility to write such ruby out from autocad.
I used such approach to restore block-infos on SU components which get lost during import.
2 thoughts:
Does SU Ruby support RubyGems package installer? Can it be loaded?
Is SU Ruby 1.8 supported by this package? (They wrote that it runs on 1.9)
Otherwise seems to be a nice package.
And when do that countries get 7.1 ?
@unknownuser said:
There are enough signs in the sky that Google is taking a turn with Sketchup and that they are doing some serious work on it for version 8.
My understanding of the blog post is that we will see a V7 update (Free to V7 User) soon with the removed DWG-Import (and a seperate install for it).
And in future V8 Major release this feature will be removed.
I do not see other announcments specially for V8.
So we will see what V7 brings other than the import-change.
The scene tabs are named views from autocad.
You can delete them in autocad.
For the lines you have to check it in autocad.
Switch to a different 3D-View (ISO SW for example) to view the real location of the lines.
Bad drawing in autocad gets not better in SU.
@unknownuser said:
Draw with AutoCAD, save the files in an open file format and send to anybody even without AutoCAD licence.
First autocad would have to support this open file format!
(And it is not sure that any other data-format transport the datat exactly as DWG.)
@unknownuser said:
a question: can you export in collada from autocad? and would it be the same importing a plan in collada as it is today in dwg/dxf?
The Google Earth plugin from the autodesk labs seems to support this!
One drawback is that only Autocad 2007 and up are supported.
(I have currently Autocad 2006 running)
@unknownuser said:
Seems to me strange to pay a tons to Autodesk for their crappy monopole and complain about Google decision! The problem is ALWAYS closed and proprietary file formats that holds you in companies prison!
I do not tell that I am happy to pay tons to Autodesk, but when I want to support customers with their prefered data-format, then I have no other chance.
(And I have to accept that they want tons of money every 3 years.)
But Autocad is still a lot better in producing drawings/3D-content in a professional/automated way. (You can not use Ruby for SU-Layout)
Also it has still much more options to customise it for your own needs (LSP/DCL/CUI/VBA).
Anyway I complain about Google that they are on the way to get the same behaviour like Autodesk.
And isn't SKP also a closed and proprietary file format?