I have the following code to create a dimension (not a dimstyle) that suppresses the 1st dimension line and puts the text near the second extension, and depending on the point selected, puts port or stbd in the text string.
(setq oldos (getvar "osmode"))
(setvar "osmode" 0)
(setvar "dimjust" 2)
(setvar "dimsd1" 1)
(setq DimPoint (getpoint "\n0,0 is readly taken care of. Please select the point you want to dimension to!"))
(setq DimPointWorld (trans DimPoint 1 0))
(setq DimPointWorldY (cadr DimPointWorld))
(cond
((> DimPointWorldY 0)(setq ShipSide "<> OCL, PORT"))
(T(setq ShipSide "<> OCL, STBD"))
)
(command "DIMLINEAR" "0,0,0" DimPoint "t" ShipSide PAUSE)
(setvar "dimjust" 0)
(setvar "dimsd1" 0)
(setvar "osmode" oldos)
I know that there are a few conditions I need to implement.
I was wondering if there was a way to apply these parameters to dimensions that already exist.
So the idea is for the user to select the dim they want the new format to be applied to, not select all.
I had a look at any differences of the dxf codes, and I couldn't seem to find any.
Thanks in advance,
KP
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@kpennell wrote:I have the following code to create a dimension (not a dimstyle) that suppresses the 1st dimension line and puts the text near the second extension....
...
I was wondering if there was a way to apply these parameters to dimensions that already exist.
So the idea is for the user to select the dim they want the new format to be applied to, not select all.
I had a look at any differences of the dxf codes, and I couldn't seem to find any.
....
That kind of variation is carried in Extended Data, rather than in "basic" Entity Data. But modifying things by way of that, in the way you would with Entity Data, is cumbersome -- much easier to use VLA Properties.
(setq dimobj
(vlax-ename->vla-object
(car (entsel "\nSelect Dimension to suppress 1st dim line and put text near 2nd ext line: "))
)
)
(vla-put-DimLine1Suppress dimobj -1)
(vla-put-HorizontalTextPosition dimobj 2)
Another method would to be to gather all the changes you want made
to the dimension style, make the changes using overrides (not saving as the
current dimension style), employ DIMSTYLE "Apply", and window or select
the objects, then (command ".DIM" "Restore" (getvar "DIMSTYLE") "Exit") to
clear out all of these overrides you set earlier.
This is basic to us when we switch to pages that are of different scale [no annotation].
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
@scot-65 wrote:....gather all the changes you want made to the dimension style, .... employ DIMSTYLE "Apply....
The one potential drawback to that approach is if you use other kinds of overrides on individual Dimensions. The Apply approach will force the current option settings for all the myriad Dimension properties onto all the selected Dimensions. So if the ones you want to adjust in this way might have different combinations of extension line suppression, or override colors assigned to any parts of them, or prefix-suffix content, etc., those would all be made uniform according to current settings, and lose their individuality.
But there is a Command:-line way to do it, without affecting any individual=Dimension overrides other than the desired ones, without setting any Dimension-option System Variables that would then need to be cleared, and without needing to convert Dimensions to VLA objects:
Command: dimoverride
Enter dimension variable name to override or [Clear overrides]: dimjust
Enter new value for dimension variable <0>: 2
Enter dimension variable name to override: dimsd1
Enter new value for dimension variable <Off>: on
Enter dimension variable name to override: {...Enter to finish choosing variables...}
Select objects: