I have a lisp routine that will add VIF under my dimension. I would like to have it on a different layer.

I have a lisp routine that will add VIF under my dimension. I would like to have it on a different layer.

jchipukites
Contributor Contributor
1,003 Views
21 Replies
Message 1 of 22

I have a lisp routine that will add VIF under my dimension. I would like to have it on a different layer.

jchipukites
Contributor
Contributor

I have a lisp routine that will add VIF under my dimension. I would like to have it on a different layer. does anyone know how to do this? See lisp below.

 

;vif.lsp
;dim text replacement
;custom

(defun c:vif (/ ss)
(setq ss (ssget))
(command ".DIM" "NEW" "<>\\xvif" ss "" "EXIT")

0 Likes
Accepted solutions (3)
1,004 Views
21 Replies
Replies (21)
Message 2 of 22

paullimapa
Mentor
Mentor

I don’t think you can have the first line of the dimension value be on a different layer than the second line since it’s the same object. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 22

jchipukites
Contributor
Contributor
If you have a dimension and type \X it will let you type under the
dimension and you can change the layer after you type VIF in. I wanted to
add to the lisp to change the layer so I dont have to do it manually
0 Likes
Message 4 of 22

paullimapa
Mentor
Mentor

If you want the entire dimension object layer to change then what would that layer name be?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 22

Moshe-A
Mentor
Mentor

@jchipukites  hi,

 

Using \X mtext control format you can not move it to another layer but you can set it to another color. if it still must have another layer then add it with separate mtext.

 

Moshe

 

0 Likes
Message 6 of 22

ВeekeeCZ
Consultant
Consultant

Is it something you can do in FUSION?

 

This sort of edits aren't possible in AutoCAD.

0 Likes
Message 7 of 22

jchipukites
Contributor
Contributor
so the dimensions are blue and the dimension line is blue but i want the
VIF to be on layer 152.
0 Likes
Message 8 of 22

jchipukites
Contributor
Contributor
how do i change the color? did you see the lisp that was attached?
0 Likes
Message 9 of 22

paullimapa
Mentor
Mentor

And what layer is the dimension object on now?

As I stated earlier the entire dimension is treated as a single object which means all parts of the dimension (including the dimension measurement value and the VIF text value) can only be on a single layer and not separate layers. Just like a PLINE which is a single object and you cannot have one segment of the PLINE be on a different layer than another segment.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 10 of 22

jchipukites
Contributor
Contributor
you can manually change the VIF, if you have a dimension and then use \x
this puts the next line under the dimension line, if you type in VIF then
select it and right click you can change the color of the VIF text. I just
cant figure out how to do this with a lisp. So if you run my lisp all you
do is click on the dimension line and it adds the VIF like I want, dont
know if I add something to the lisp that will also change the color.

Thank you
0 Likes
Message 11 of 22

paullimapa
Mentor
Mentor
Accepted solution

so you don't want to change the layer but the color to 152...now that is possible by modifying your lisp like this:

(defun c:vif (/ ss)
(setq ss (ssget))
(command ".DIM" "NEW" "<>\\X{\\C152;vif}" ss "" "EXIT"))

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 12 of 22

jchipukites
Contributor
Contributor
Awesome let me give this a try. this is what i am trying to do.
[image: image.png]
0 Likes
Message 13 of 22

king
Enthusiast
Enthusiast
Accepted solution

Do you want the VIF to be a different layer, or a different color? Those are 2 different things. If you want VIF to simply be a different color, your code would look something like:


(defun c:vif (/ ss)
  (setq ss (ssget))
  (command ".DIM" "NEW" "<>\\X\\C152;VIF\\C;" ss "" "EXIT")
  (princ)
)
0 Likes
Message 14 of 22

paullimapa
Mentor
Mentor

no png attached...but modified lsp should work...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 15 of 22

jchipukites
Contributor
Contributor
Sorry for any confusion I am looking to have it another color
0 Likes
Message 16 of 22

Kent1Cooper
Consultant
Consultant

@Moshe-A wrote:

.... you can not move it to another layer but you can set it to another color. ....


And, if it helps, to other Mtext-editable override characteristics [different font, height, proportions/spacing, underline, bold, etc.]:

Kent1Cooper_0-1760122081675.pngKent1Cooper_0-1760122081675.png

But no, not another Layer.

Kent Cooper, AIA
0 Likes
Message 17 of 22

jchipukites
Contributor
Contributor
Got it thank you.

Thank you
0 Likes
Message 18 of 22

Kent1Cooper
Consultant
Consultant
Accepted solution

[Oops -- looks like I've been pre-empted, but anyway....]

If what you meant in Message 7 was color 152, rather than Layer 152, change

"<>\\xvif"

to

"<>\\X{\C152;VIF}"

[You don't need the concluding \\C; part in @king's suggestion if this is the end of the text override content.  If there was more to follow that you wanted back at the original color, that would be needed.]

EDIT:  I find you don't even need it when there's more to follow.  This content:

<>\X{\C152;VIF} test

results in this:

Kent1Cooper_0-1760123653103.pngKent1Cooper_0-1760123653103.png

The right curly bracket concludes the color assignment, without the need for a reset.

Kent Cooper, AIA
0 Likes
Message 19 of 22

jchipukites
Contributor
Contributor
No it would need to be autocad.

Thank you
0 Likes
Message 20 of 22

jchipukites
Contributor
Contributor
Yes. Thank you.
0 Likes