linkedin
Q:

Can I edit the text used in a sketch that drives an Emboss feature via the API?

  • Mayuresh Yerpude
  • Mar 29, 2026

1 Answers

A:

Yes, you can edit the text inside a sketch used by an Emboss feature via the Inventor API — and there’s a clean way to do it programmatically.

Sample VB.NET / VBA Code


Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition

For Each oEmboss As EmbossFeature In oCompDef.Features.EmbossFeatures
    Dim oSketch As PlanarSketch = oEmboss.Profile.Parent

    For Each oTextBox As TextBox In oSketch.TextBoxes
        Debug.Print "Original Text: " & oTextBox.Text
        oTextBox.Text = "Updated Text Here"
    Next
Next

This:

  • Navigates to each EmbossFeature
  • Accesses the sketch used for the emboss profile
  • Loops through all TextBox objects in the sketch
  • Updates the text content
  • Dhairya
  • Apr 01, 2026

0 0

Related Question and Answers

Q:

A:

HANDBRAKE is one of the most popular and free video conversion tools.

It is open source, easy to use, and works on Windows and Mac.

  • Mir Hussain
  • Mar 25, 2026

A:

Yes, Nishan-it is possible to build an Inventor assembly file (.iam) offline, without launching the Inventor UI, using the ApprenticeServer API.

You can prepare a blank .iam template and use Apprentice to:

  1. Open the template
  2. Insert existing .ipt files as component occurrences
  3. Save the modified .iam

Here’s a simplified VB.NET snippet using Apprentice:


Dim apprenticeApp As New Inventor.ApprenticeServerComponent
Dim asmDoc As ApprenticeServerDocument = apprenticeApp.Open("C:\Templates\BlankAssembly.iam")

Dim partDoc As ApprenticeServerDocument = apprenticeApp.Open("C:\Parts\MyPart.ipt")
Dim asmCompDef As ApprenticeComponentDefinition = asmDoc.ComponentDefinition

' This part is tricky — Apprentice does not expose AddOccurrence directly
' You'd need Inventor API for precise placement and constraints

asmDoc.SaveAs("C:\Assemblies\BuiltOffline.iam", False)
  • Ram Upadhyay
  • Apr 01, 2026

A:

Here’s how to make it work more reliably:

  1. Initialize Apprentice Properly

    Make sure Apprentice is initialized before loading the control:

    
    Dim appServer As Inventor.ApprenticeServerComponent = New Inventor.ApprenticeServerComponent()
            
  2. Use Static Viewing Instead of Interactive Tools

    Avoid using toolbar buttons like Rotate or Zoom directly. Instead, control the view programmatically:

    
    Dim viewCtrl As InventorViewControl = Me.InventorViewControl1
    viewCtrl.ViewOrientation = Inventor.ViewOrientationEnum.kIsoTopRightView
    viewCtrl.Fit()
            
  3. Disable Toolbar or Customize It

    If Rotate causes crashes, disable or hide it:

    
    viewCtrl.ToolbarVisible = False
            

    Or selectively enable safe tools:

    
    viewCtrl.ToolbarVisible = True
    viewCtrl.EnableZoom = True
    viewCtrl.EnablePan = True
    viewCtrl.EnableRotate = False ' Disable problematic tool
            
  4. Use Try-Catch Around View Manipulation

    Protect your code from runtime exceptions:

    
    Try
        viewCtrl.RotateView(30, 0) ' Example: rotate 30 degrees around X
    Catch ex As Exception
        MessageBox.Show("Rotate failed: " & ex.Message)
    End Try
            
  5. Ensure Graphics Compatibility

    Make sure your system supports DirectX 11 and your form has proper DPI and scaling settings. Some crashes stem from graphics context mismatches.

  • Dhairya
  • Apr 01, 2026

A:

Sheets in Inventor are named using the Sheet.Name property. By default, they follow a simple pattern:

  • Sheet1, Sheet2, etc.
  • You can rename them manually or programmatically using:

sheet.Name = "Assembly Overview"

You can delete sheets using the Inventor API or iLogic. Here's a VB.NET-style snippet that safely deletes all sheets except the first:


Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheets As Sheets = oDoc.Sheets

' Delete all sheets except the first one
Do While oSheets.Count > 1
    Dim lastSheet As Sheet = oSheets.Item(oSheets.Count)
    lastSheet.Delete()
Loop
  • Nitin parate
  • Mar 30, 2026

A:

Yes, you can detect whether dimensions in a drawing were retrieved from the model (IPT file) using the Inventor API. Here's how to do it:

Sample Code: Check if Dimension Was Retrieved


Dim oDrawingDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDrawingDoc.ActiveSheet

For Each oDim As GeneralDimension In oSheet.DrawingDimensions.GeneralDimensions
    If Not oDim.RetrievedFrom Is Nothing Then
        Debug.Print("Dimension '" & oDim.Text.FormattedText & "' was retrieved from model.")
    Else
        Debug.Print("Dimension '" & oDim.Text.FormattedText & "' was manually created.")
    End If
Next

This lets you:

  • Identify dimensions linked to the model (IPT)
  • Filter out manually created dimensions
  • Optionally tag or style them differently
  • Manisha
  • Mar 31, 2026

Find the Best CAD Software

Explore all products with features, pricing, reviews and more

View All Software
img

Have a Question?

Get answered by real users or software experts

Ask Question

Help the community

Be the First to Answer these questions

How can I execute a macro from Default.ivb using a ribbon/add-in button?

Write Answer

How do I make clickable email and website links on a WinForms “About” or support form?

Write Answer

How can you create a Fold feature in a Sheet Metal part via the Inventor API, and what are the key steps and objects involved (sketch line, FoldDefinition, FoldFeatures)?

Write Answer

How can you detect whether a document is visible or not in Inventor from VC++ via COM, and why is checking Document.Views.Count a good approach?

Write Answer

Still got Questions on your mind?

Get answered by real users or software experts

Disclaimer

Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.

Software icon representing 20,000+ Software Listed 20,000+ Software Listed

Price tag icon for best price guarantee Best Price Guaranteed

Expert consultation icon Free Expert Consultation

Happy customer icon representing 2 million+ customers 2M+ Happy Customers