cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

VBA points and varText

KM_10319639
3-Visitor

VBA points and varText

Hello,

 

I'm trying to place a symbol at specific location on drawing. I created a symbol which has (or should have, i currently don't know if it works) a variable text (text would change based on dimension index; so from 1 to x)

 

I managed to get the symbol definition and place the symbol at a location which i choose with mouse. So next i tried setting the location with the x,y location that i get from a dimension on drawing and that's where i got to a problem where i can't create a point somehow.

Code:

 

dim lok_x as double

dim lok_y as double

dim point as new cpfcpoint2d

 

 

dim allattachments as ipfcdetailleaders 

dim allattachments_cr as new ccpfcdetailleaders

set allattachments = allattachments_cr.create()

allattachments.itemattachment = position

sym_in.instattachment = allattachments

 

Bold section works with position variable that i set with point variable which is set with mouse click on drawing. How would i set that point with known x,y location?

 

My second problem is related to the variable text in symbol.

 

Dim variabletext As String
Dim vartext As IpfcDetailVariantText
Dim vartexts As IpfcDetailVariantTexts
Dim vartexts_cr As New CpfcDetailVariantTexts
Dim vartext_cr As New CCpfcDetailVariantText

 

Set vartext = vartext_cr.create("TEST", variabletext)
Set vartexts = vartexts_cr.Append(vartext)

 

the .append gets marked with an error saying "expected variable or function" and i'm kinda lost on what to do now.

 

Lastly, unrelated question to this topic but still very related to everything...

What exactly do Ipfc, CCpfc and Cpfc mean or better, how would i know which one is the one to chose based on what i'm trying to do?

 

Appreciate the answers!

 

 

0 REPLIES 0
Top Tags