Novice iLogic Question: Inserting Text in View Label

Novice iLogic Question: Inserting Text in View Label

cadman777
Advisor Advisor
906 Views
5 Replies
Message 1 of 6

Novice iLogic Question: Inserting Text in View Label

cadman777
Advisor
Advisor

Here's another novice iLogic question that's got me puzzled, for which I haven't been able to find anything on the Forum addressing this specifically. Any insight would be appreciated.

 

Can iLogic INSERT text into a label?

 

All the coding I've read appears to either start from scratch or delete the entire label and start over.

And then it builds the label from scratch, adding every piece of text you want in the label.

Is that correct?


If so, is there a way to INSERT TEXT at any point in an existing label?

 

Same with FORMATTING view label text.

 

Is there a way to format an existing label by merely changing the TEXT FORMATTING to an existing idw Style?

 

Example: You have a lot of legacy drgs that need the label TEXT STYLE updated. Back in my AutoCAD days, I would create a selection-set of all the text in a label, then set it to 'default' properties, and then assign a 'text style' to it. Then the text would update to that particular style. And in the future if a new style is called for, all I'd have to do is change that style in each drgs (not each individual text) to change the text formatting. Simple. Actually, I have AutoLISP programs that update my titleblock with the press of a button, just like that. I also adapted that AutoLISP to drgs I got from 'foreigners' to 'fix' their titleblock. But I don't use AutoCAD anymore, and need to learn how to do it in iLogic (VB.net).


Would someone please give me some idea how on do these 2 things?

 

Thanx ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
907 Views
5 Replies
Replies (5)
Message 2 of 6

Tony_Yates
Advocate
Advocate

Hi,

 

This ilogic we use to change the label on our flat pattern view.

doc = ThisDoc.Document 
For Each oSheet In doc.Sheets 
  For Each oView In oSheet.DrawingViews 
    If oView.IsFlatPatternView  Then 
        


'Reference to the drawing view from the 1st selected object
'Dim oView As DrawingView = trycast(oSSet.item(1), DrawingView)

'If oView IsNot Nothing Then
'oView.ShowLabel = True
'format the model iproperties	
oFlatpattern = "<Br/><StyleOverride Underline='True'> DEVELOPMENT  - FOR REFERENCE ONLY</StyleOverride>"
oDescription = "<Br/><StyleOverride Underline='True'><Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
oStringMass = "<Br/><StyleOverride Underline='False' FontSize='0.35'>FOR REFERENCE ONLY </StyleOverride>"
oStringScale = "<Br/><StyleOverride Underline='True'><Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>"
'add to the view label
oView.Label.FormattedText =  oFlatpattern 'oStringMass &  '& oDescription & oStringScale	    


End If

 
  Next 
Next 
0 Likes
Message 3 of 6

cadman777
Advisor
Advisor

Thanx for sharing this, Tony.

Let me see if I can get it to work for me.

Much obliged!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 4 of 6

cadman777
Advisor
Advisor

Hi Tony,

I finally got time to try you macro.

It doesn't do what I want.

I want to insert text into the label at a specific location.

Your macro wipes out the entire view label and inserts only the text your macro specifies.

I don't want to wipe out the entire label.

Instead, I want to keep the entire label and add some text and some iProperties to what already exists.

Do you know if this is possible?

If not, then I'll be very disappointed!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 5 of 6

Tony_Yates
Advocate
Advocate

If not, then I'll be very disappointed! - WTF

 

Add 

oView.Name

and if you want a new line add  

vbNewLine

 

oView.Label.FormattedText =  oView.Name & vbNewLine & oDescription & oPartNumber & oStringMass & oStringScale
0 Likes
Message 6 of 6

cadman777
Advisor
Advisor

Thanx for the info Tony.

 

LOL @ "WTF"!

 

For non programmers like me, this is a world of mystery and magic.

Ever try to learn to read and write Chinese?

(I'm serious!)

 

Cheers!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes