[Drawkit] SonoDraw source available, incorporating DXFReader

Allan Daly allandaly at me.com
Wed Jul 8 09:26:10 PDT 2009


Hi Brad,

Looks great. Thanks for sendings this out to everyone. It's a treat  
for me to see the DXFReader framework used in your app.

I had to make a few small changes to the downloaded zip files to get  
them to compile and run on my machine. Here are a few notes that  
perhaps you can incorporate into your bundle release or that will at  
least help others get this working.

1) You need to have the thoughtfultree InspectorKit plugin loaded into  
Interface Builder. To do this you double-click on the  
InspectorKitPlugin.ibplugin file in the InspectorKit/build/release  
folder.

2) The GCDrawKit.framework you link to in your SonoDraw XCode project  
is the release version. When I built your project it only generated  
the debug version of the GCDrawKit.framework so I needed to go into  
the DXFReader.xcodeproj and manually build the release version of the  
framework so it would be there to link to.

3) The path set for the linked InspectorKit.framework is '/Users/ 
larson/Development/InspectorKit/build/Release/InspectorKit.framework'.  
This needs to be reset to the correct location on a user's computer  
instead of this absolute path. (Might also need to check to see that  
the release build is created correctly. I forget if this was needed.)

4) The path set for the linked DXFReader.framework is '/Users/larson/ 
Development/dxfreader/build/Release/DXFReader.framework'. This needs  
to be reset to the correct location on a user's computer instead of  
this absolute path. (Might also need to check to see that the release  
build is created correctly. I forget if this was needed.)

5) Also, I have my build settings defined to treat warnings as errors,  
so the compiler stopped on these warnings:
/Users/allan/projects/SonoDrawBundle2/SonoDraw/SPDocumentInspector.m: 
206: warning: conflicting types for '-(void)setSelectedDrawingObject: 
(DKDrawablePath *)newValue'
/Users/allan/projects/SonoDrawBundle2/SonoDraw/SPDocumentInspector.h: 
33: warning: previous declaration of '-(void)setSelectedDrawingObject: 
(DKDrawableObject *)_value'

Looks like in the header file for SPDocumentInspector you are defining  
the argument to the setSelectedDrawingObject: method as a  
DKDrawableObject but in the implementation file you are defining it as  
a DKDrawablePath. I went into SPDocumentInspector.m and changed the  
argument type for this method to a DKDrawableObject (to use the base  
class).

Once I made these small changes the project complied and ran just  
fine. I'm not sure if (5) is strictly required or what the impacts  
might be of changing that argument type might be -- but the  
application seemed to run fine after I made that change. Any thoughts  
on this?

Thanks again for making your work available to everyone. I certainly  
have learned a lot by looking through your source code as an example  
for my own project.

-Allan



On Jul 7, 2009, at 3:54 PM, Brad Larson wrote:

> I thought that people might be interested in the source code for the  
> latest build of our in-house CAD application SonoDraw.  A full  
> source bundle, including all supporting frameworks, can be  
> downloaded from here:
>
> http://www.sonoplot.com/SonoDraw/SonoDrawBundle-2.2.zip
>
> This version finally integrates work that Allan Daly and Michael  
> Caron have done on the DXFReader framework and its connection to  
> DrawKit.  Only simple drawing elements are imported from DXFs right  
> now.  Because DXF doesn't do a good job of specifying units, the  
> user is prompted for the conversion factor when a DXF is loaded.   
> Also, in order to account for the difference in starting origin  
> between DrawKit (and our machine) and standard CAD programs, I  
> manually go through and flip the items about the center of the  
> drawing when the DXF has finished loading.  Still, this is workable  
> for many of our users.  Thanks again, Allan and Michael, for  
> enabling this functionality.
>
> Additionally, Graham, I've made some modifications to the  
> DKRouteFinder class in the DrawKit framework bundled with the source  
> above.  I've added support for having two points for each object to  
> be sorted, where the sort now finds the shortest distance between an  
> object and either point on each other object.  This lets paths be  
> sorted in a more natural manner for our robot (connected lines are  
> sorted to be drawn one after another, etc.).  Also, I was running  
> into some glitches with sorts on grids, so I found that if I  
> replaced the side-to-side sweeping heuristic with a simple Y  
> distance check, I was able to eliminate these problems.  When  
> searching for the next object, if more than one object is  
> equidistant from the current one, the object with the smallest  
> difference in Y location is preferred.  I haven't had a chance to  
> clean up the code in this class, so I apologize for the mess.
>
> ______________________
> Brad Larson, Ph.D.
> SonoPlot, Inc.
> 3030 Laura Lane, Suite 120
> Middleton, WI 53562
>
>
>
>
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20090708/21be11d3/attachment.htm>


More information about the Drawkit mailing list