Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

change dimsd1 and dimjust of existing dims

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
kpennell
496 Views, 5 Replies

change dimsd1 and dimjust of existing dims

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

5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: kpennell


@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)

Kent Cooper, AIA
Message 3 of 6
kpennell
in reply to: kpennell

Thanks KC,

 

I'll be checking it out first thin Tuesday morning, maybe tonight if I get a chance.

Message 4 of 6
scot-65
in reply to: kpennell

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.


Message 5 of 6
Kent1Cooper
in reply to: scot-65


@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:

Kent Cooper, AIA
Message 6 of 6
kpennell
in reply to: kpennell

That's the one KC.

 

Do you recomend and "vla" literature "for dummies" that one can read?

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost