Jump to content

Recommended Posts

Posted

So I am trying to expand upon a routine that I wrote to apply background masks to different objects. The issue I am running into is when I try and change properties of AECC label styles. I cannot figure out how to change the properties that correspond to background masks normally and for dragged state. When I do a dump of an object, the label style shows up as useless information.

LabelStyle = #

. I then iterate down one level, which gives me information on the label style, but I cannot find anything on background masks. I can iterate down another level and get information on DraggedComponentStyle, but this doesn't seem to have any information on background masks as well. Does anyone have any suggestions?

Posted

In civ3d some of the labelstyle info is actually held in a different location, I was trying to get at layer information in styles and found some of the answers are elswhere. I spent a lot of time trawling through the styles and some of the labels have a description but the name is slightly different like align v's aligns

 

; vercheck returns *AeccDoc* for the particular version
(if (not ah:vercheck)(Load "vercheck"))
(ah:vercheck)
(setq gnl (vlax-get *AeccDoc* 'GeneralLineLabelStyles))
(setq std (vlax-get-property gnl 'item "Bearing and Distance 2.5mm >500m"))
(setq labprop (vlax-get std 'LabelProperties))
(setq lay (vlax-get labprop 'Layer))
; (vlax-dump-object lay)
;   Value = "0" layer name
(vla-put-Value lay "text")

Posted

I was able to find background masks under BorderStyle, under TextComponent, under TextComponents, under LabelStyle.

 

(setq obj (vlax-ename->vla-object (car (entsel ))))
(setq lblstyle (vlax-get-property obj 'LabelStyle))
(setq tcoms (vlax-get-property lblstyle 'TextComponents))
(setq tcom (vlax-get-property tcoms 'Item 0))
(setq bordStl (vlax-get-property tcom 'BorderStyle))

Posted
I was able to find background masks under BorderStyle, under TextComponent, under TextComponents, under LabelStyle.

 

(setq obj (vlax-ename->vla-object (car (entsel ))))
(setq lblstyle (vlax-get-property obj 'LabelStyle))
(setq tcoms (vlax-get-property lblstyle 'TextComponents))
(setq tcom (vlax-get-property tcoms 'Item 0))
(setq bordStl (vlax-get-property tcom 'BorderStyle))

Hippe, thank you! So when I did a dump of bordstl, I saw that the background mask property was in there. However, I cannot seem to actually set it. The corresponding code for a mask seems to be -1, but when I try to set it by doing
(vlax-put-property bordstl 'BackgroundMask -1)

nothing actually happens. Do you happen to know what I am doing wrong?

Posted

Try the following:

 

(vlax-put-property bordstl 'BackgroundMask :vlax-true)

 

OR

 

(vlax-put-property bordstl 'BackgroundMask :vlax-false)

 

Though I am finding that this is only working for the NON dragged state. This is not having an effect on the dragged state background mask.

Posted

I am not sure but I think your going the wrong way you may have to have a label style with the background mask set and then change the point style to that one. Look at property of a point and change "Style" not point label style. I have played with it but its still not quite right but close, I think there is some overide settings kicking in.

 

(vlax-put-property lblstyle 'name "your label")

Posted

In doing a bit more research about this, it appears that the background mask is exposed for the text component, though it doesn't appear to be exposed for the dragged state component. It is however exposed in the .NET framework.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...