[Drawkit] Converting units

Brad Larson larson at sonoplot.com
Thu May 22 15:28:08 PDT 2008


On May 21, 2008, at 9:38 PM, Graham Cox wrote:

>
> If your code is exactly as above, what you've missed is creating and  
> adding the grid layer. I see a guide layer, but no grid layer.
> After adding the grid layer, call its -synchronizeRulers method to  
> get it to take up the drawing units and conversion factor you set.
>
> Otherwise I think what you're doing should work. If you have a lot  
> of objects to read in though I'd probably look at not calling the  
> grid layer for every one, but applying the necessary conversion  
> factor directly - it will be a lot faster.
>

Yeah, I somehow forgot that when I copied my initialization steps  
across.  I now have the file import working for our in-house XML  
file.  If everything checks out here, I'll post the code and project  
files for our drawing program as an example of file loading.  I am  
having a few issues after loading, which I'll describe separately.   
The next step is saving.


>>> [currentPath setPathEditingMode:kGCPathCreateModeLineCreate];	
>
> 	
> I wouldn't bother doing this, as you're not creating the lines  
> interactively, which is all this is there to support. You might also  
> find it prevents proper editing of the object later. Just leave it  
> set to the default value (i.e. don't set it).
>

OK, done.

>
> cheers, Graham
>
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net

______________________
Brad Larson
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562





More information about the Drawkit mailing list