Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I'm try to scale a image that i imported throw insert image command. But I don't know how to scale it. The scale factor need's to be 1.35.
Here is the code i have:
Sub Main()
' ***Change path to point to the desired bmp file.
Dim strImagePath As String
strImagePath = "C:\Temp\1.jpg"
' Create a new part document, using the default part template.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, _
ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject))
' Set a reference to the component definition.
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
' Create a new sketch on the X-Y work plane.
Dim oDecalSketch As PlanarSketch
oDecalSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes(3))
' Set a reference to the transient geometry object.
Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry
Dim oCenter As Point2d
oCenter = oTransGeom.CreatePoint2d(0, 0)
' Add a sketch image
Dim oSketchImage As SketchImage
oSketchImage = oDecalSketch.SketchImages.Add(strImagePath, oCenter)
' Edit sketch
oDecalSketch.Edit
' Try set image Height & Width (better a scale factor)
Dim iHeight As Double
iHeight = oSketchImage.Height
iHeight = 10
Dim iWidth As Double
iWidth = oSketchImage.Width
iWidth = 20
End Sub
Solved! Go to Solution.