Jump to content

elem.Name = TxtAttBlock.text Does not match Why


muck

Recommended Posts

I am using AutoCAD VBA

I am debuging a VBA AutoCAD Program for the following statement

 

If elem.Name = TxtAttBlock.text Then

 

This statement is false even when is see the strings match each other in de******.

Is this because they are not the same type of variable? If so, how do

I make this statement test for a string match?

 

Thank you,

 

For your Information I am using the following code.

 

For Each elem In ThisDrawing.PaperSpace

If elem.EntityName = "AcDbBlockReference" Then

If elem.Layer blocklayer Then GoTo NxtelemPaper

elemText = elem.Name

If elem.Name = TxtAttBlock.text Then

foundAttributes = True

Array1 = elem.GetAttributes

c = c + 1

End If

End If

End if

Link to comment
Share on other sites

When you get attributes it saves them in an array style so attibute 0 is first 1 is next attribute

array1(0) etc

 

found it a couple of posts down

 

myAttributes = myObject.GetAttributes

myval = myAttributes(0).TextString

Link to comment
Share on other sites

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...