高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】need dimension advice
need dimension advice
need dimension advice
i'm converting my old opendwg code over to dwgdirect, and i used to have quite a bit of control when adding an aligned dimension over the size and location of each and every element. i like that it is easier now, but i still need to be able to set the text size and arrow size when i add an aligned dimension to storage. can anyone advise how to do it? there do not appear to be any direct functions... i probably have to monkey with styles somehow?
it seems you should study dimension styles and dimension variables (refer to autocad help). the apperance of dimension block depends on near 50 different parameters.
there is dimension style concepts (dimension style is set of values of dimension parameters).
oddbdimension entity has methods setdimensionstyle (for setting style for the dimension) and setdimvar (var is an dimension variable; for setting parameter override).
sincerely yours,
george udov
more advice?
yes, i need to learn more about those styles. where is the best place to get the autocad help you mention? i've heard people refer to the autocad documentation (for arx, i suppose?), but i've only used opendwg, and programmed based on their sample code (don't have autocad... just lt). where can i find more? the dwgdirect examples do not seem to address dimension styles or much else regarding dimensions.
also, i do not see a setdimvar in the dwgdirect help file?
regrettably, dwgdirect help file doesn't describe meaning of each dimension variable. dimension variables are described in autocad user documentation, not in arx reference. also you can type something like "autocad dimension style variables" in any internet search engine, and you'll get a lot of links to documentations.
sincerely yours,
george udov
dimension variables in opendwg
ok, i've got an extremely large book now with dimension variables, but i am still at a loss as to what sort of coding would be required to set the text height for a dimension that i am adding. i see very little sample code dealing with these dimension details. with opendwg it was easy to control everything, because you had to draw everything yourself!
my current task is to convert some opendwg code that translated our proprietary cad dimensions one at a time into dwgdirect. any advice on writing code to set or override the text height, arrow size, etc. for each dimension would be greatly appreciated.
with dwgdirect you can generate dimension blocks by yourself too. in this case you should call setgraphicsmodified(false); to avoid automatically recomputing of dimension block by dwgdirect.
but recomputing dimension blocks by yourself is kind of cheat. because autocad in some cases (for example, if you change color of dimension) will recompute block, basing on dimension variables.
so correct way is to set up dimension variables. to set text size, use dimtxt variable (pdim->setdimtxt method). to set arrows size, use dimasz variable (pdim->setdimasz method). these methods presents for all kinds of dimension.
sincerely yours,
george udov
last edited by george udov; 7th april 2004 at 01:06 amfff">.
don't forget the dimscale variable multiplies the dimtxt (and every other linear) dimension variable.
thanks...
that was very useful.
quote:
originally posted by george udov
with dwgdirect you can generate dimension blocks by yourself too. in this case you should call setgraphicsmodified(false); to avoid automatically recomputing of dimension block by dwgdirect.
but recomputing dimension blocks by yourself is kind of cheat. because autocad in some cases (for example, if you change color of dimension) will recompute block, basing on dimension variables.
so correct way is to set up dimension variables. to set text size, use dimtxt variable (pdim->setdimtxt method). to set arrows size, use dimasz variable (pdim->setdimasz method). these methods presents for all kinds of dimension.
false method name
quote:
originally posted by george udov
with dwgdirect you can generate dimension blocks by yourself too. in this case you should call setgraphicsmodified(false); to avoid automatically recomputing of dimension block by dwgdirect.
but recomputing dimension blocks by yourself is kind of cheat. because autocad in some cases (for example, if you change color of dimension) will recompute block, basing on dimension variables.
so correct way is to set up dimension variables. to set text size, use dimtxt variable (pdim->setdimtxt method). to set arrows size, use dimasz variable (pdim->setdimasz method). these methods presents for all kinds of dimension.
setgraphicsmodified(false); means
recordgraphicsmodified (false);
|