Determine if object is text, circle, etc

I have a drawing that when I ungroup it in Visio, I get individual objects.   That was the my purpose was to break the drawing down.

 

Is there any way for me to determine if a selected object is Text, a Circle, a line segment, etc.  in Visio???    Using VBA ???

 

Do you have an suggestions ?

 

Thank You,

 

G

each shape has attributes including the name of the master that it is an instantiation of.

dim strMaster as string

strMaster = visShape.master

 

al

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

As well as what al says, don't ungroup shapes, they will probably break. Use the Drawing Explorer window to explore shapes.

Visio stencils and addons for engineering and software
https://www.paulherber.co.uk/

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

The drawing isn't a Visio drawing.   I think its composed of metafiles ??

 

When I ungroup them, and high lighted a circle object, I used the Format > Speical and it indicate that there is <No Master> for this.

 

If that was the case, is there other methods to determine if the object is text or a circle, etc ??

 

Thank You,

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

If the file has come from AutoCAD or similar then the shapes won't have masters. They will just be metafiles; these are just vector graphics with no concept of named shapes.

Visio stencils and addons for engineering and software
https://www.paulherber.co.uk/

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Al indicated that by ungrouping the shapes, they have no mater because these shapes must be "metafiles".

 

I tried using the Show Shapesheet window and selected the individual objects, and I was able to determine if the object was text because "LinePattern" was not 0 but had a number like 1.   The "LineWeight" was not zero.   That seems to tell me that this is not a line or circle for now and it is a text.   I also checked the "Character Font Size".  Even for a line, there is a Font Size but its an integer and when I really have a text its fractional.

 

I am unable to tell the difference from a line segment and a circle right now.

It seems that all of the properties are the same.   Do you have any suggestions ??

 

How do I check the "LinePattern" in VBA code??

 

Thanks,

G

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Any shape can have text, so using the LinePattern is not going to give you much success. You unfortunately will not have much luck doing in code.

IF you want to use VBA to find the Line Pattern use something like

ShapeObj.Cells("LinePattern") or

ShapeObj.Cells("LinePattern") = 1

to set it

 

JM Visio MVP since 93 @VisioMVP

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I have been successful in determining the text, circles, and squares by using "LinePattern", and "FillPattern" to determine if its text or circles or squares in the drawings that I ungroup in Visio. 

 

The harder part is grouping the dash line together, and other line segments.   Here I need to also look at the "PinX" and "PinY" and using "Spatial Relationship".   I am only getting about 75%.   I think I can improve that.   

 

Do you have any suggestions to help be group the individual lines that may be part of a give Dash line ??   I am trying using the following:  "width" and "height" because the dash line has its segments about the same size.   I am also using the "Spatial Relationship" to see if they are close to each other.

 

I am also using the slope of the points and trying to determine if the next point is part of the line equation generated by the other points.

 

Any other suggestions ??

 

Thanks,

 

G

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 103 Applies to: