Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scale in Sketch Symbol with ilogic

5 REPLIES 5
Reply
Message 1 of 6
jamesc
941 Views, 5 Replies

Scale in Sketch Symbol with ilogic

I am trying to create a sketch symbol with info about the first view on a sheet.  It seems to work fine with any of the properties built in, but I am trying to incude the scale.  There are lots of posts about putting scale in a titeblock, but I can't seem to get the same code to work for a sketch symbol.

 

Any suggestions?

5 REPLIES 5
Message 2 of 6
yannicknielsen
in reply to: jamesc

Dim strScale As String = ActiveSheet.View("VIEW1").ScaleString
iProperties.Value("custom", "1st view scale") = strScale 

 

This one will create a custom iProperty in the document, with the name of "1st view scale".

I'm no expert, but from what I know, you have to create that iProperty first, in order to use it in a sketch symbol.

 

What you do is to add text to your sketched symbol, and then instead of writing something, you throw in a custom iProperty.


The code above only works if you have a view named VIEW1, but you can switch that part to whatever you name your views

---------------------------------------------------------------------------------------------------------------------
Product Design Suite Ultimate 2021
Message 3 of 6
jamesc
in reply to: yannicknielsen

Thanks.  That sounds like exactly what I want.  Where am I supposed to put that code?  I made it a rule, and it errored outs saying "End of statement expected."   I tried adding an "End" function and that didn't work.

 

If I can get an iProperty then I can get it into the sketch no problem.

Message 4 of 6
yannicknielsen
in reply to: jamesc

'If ActiveSheet.View=("VIEW1") Then
Dim strScale As String = ActiveSheet.View("VIEW1").ScaleString
iProperties.Value("custom", "1st view scale") = strScale 
'end if

 That's odd. I left out part of the code that was commented out.
I'm no wizard, but if this doesn't work, try removing the apostrophes.

---------------------------------------------------------------------------------------------------------------------
Product Design Suite Ultimate 2021
Message 5 of 6
jamesc
in reply to: yannicknielsen

Hmmm.  I tried without the apostrophes and it popped 2 error codes:

 

Error on Line 1 : Argument not specified for parameter 'viewName' of 'Public ReadOnly Property View(viewName As String) As Autodesk.iLogic.Interfaces.ICadDrawingView'.
Error on Line 1 : End of statement expected.

 

Sorry this is a pain.  I really appreciate the help.  It would be nice if autodesk had sheet scale property so we didn't have to fake it.

Message 6 of 6
yannicknielsen
in reply to: jamesc

Can you post a drawing file with the rule attached ? (Not an external rule)

 

I'd like to see what you're seeing 🙂

---------------------------------------------------------------------------------------------------------------------
Product Design Suite Ultimate 2021

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report