ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcDbPolyline displayed incorrectly when using setLineTypeScale

1 REPLY 1
Reply
Message 1 of 2
ruWing
315 Views, 1 Reply

AcDbPolyline displayed incorrectly when using setLineTypeScale

Hello.

 

I have a linetype, which consists of two parallel straight lines. This linetype is loaded through shp and lin files. Some lines of a drawing of type AcDbPolyline use this linetype. There is also a regenerating procedure, which rescales linetype, for the screen distance between two straights of the linetype to be 1 mm, after any change of view scale. This procedure uses setLineTypeScale. Parameter for this method is calculated depending on the view scale.

 

When the drawing is generated first, lines that use that linetype look correctly. When I change the view scale, using the mouse wheel, screen width between the starights of the linetype changes accordingly, but this is ok. When then the drawing is rgenerated by my procedure, the linetype is rescaled, and the screen width between the linetype straight gets 1 mm again, and that is intended and ok. Until now everything is fine. When the drawing is scaled by its borders, the linetype scaling coefficient is about 400.

 

Then I add a raster image (jpg) on the drawing. At the end of this, lines of this linetype lose there screen wdth, and look incorrectly. The linetype scaling coefficient at this time remains the same, 400. On regenerating, the procedure repeats setting 400. The view scale remain the same. But the line size is lost. To get the screen width of the line 1 mm again, I have to put linetype scale about 2.  Width of the line was 0 and is not changed.

 

So I came to a conclusion that screen size of a line depends not only on linetype scale. There might be some other parameter.  What is that parameter, and how to get it using ObjectARX? I should have rescaled the linetype with 2 and not 400, but I don't know what has changed to take it into account.

 

Or there might be some other way to use two-starights linetype, with 1 mm distance on the screen for any view scale?

 

AutoCAD is 2010.3

 

Thanks in advance.

 

View scale is calculated this way:

double GetViewScale()
{
   resbuf viewsize;   acedGetVar(L"viewsize",&viewsize);
   resbuf screensize; acedGetVar(L"screensize",&screensize);
      
   double height = viewsize.resval.rreal;
   double screenheight = screensize.resval.rpoint[Y];
   
   return height/screenheight;
}

 

The linetype is constructed this way:

// in .shp file
*216,15,RRS
1,3,50,020,2,028,4,35,02C,3,35,028,1,070,0

// in .lin file
A,0.00000001,[RRS,mylin.shx,S=1.6],0.22,0.00000001 

 

1 REPLY 1
Message 2 of 2
ruWing
in reply to: ruWing

I solved the problem, sorry for disturbing.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost