I'm new to Solid Edge programming and needed a little support.
I'm copying a sketch from draft to part document programmatically but it gets copied somewhere in the part file.
So, im trying to move the copied sketch to a specific coordinate(lets say origin in this case) but not able to find any method or way to do it.
Does anyone has any idea or piece of code that could help in this regard?
Thanks in advance.
I can give you some hints since the code is not available handy.
You need to access a Profile, supposing that you are pasting using the Paste method.
The equivalent of a Draft sheet in the Part environment is the Profile which is declared as:
Dim seActiveSketch As Profile
and accessed as:
seActiveSketch = seDocPart.ActiveSketch
I think there is a Paste Method there assuming that you have previously copied the sketch from Draft.
Yeah.. I'm copying from Draft file and then pasting in the part file using Profile.Sketch() method.
But the issue is, it's getting pasted at some far away coordinates and I want it to be at some specific location or coordinates. So basically I want to move my sketch from one position to another.
And I'm not able to find any methods in Sketch object to do so.
Give me a couple of hours, not having Solid Edge right now.
I had done this recently using a constant to 'paste to original coordinates' or 'at the selected point'.
I think in your case, it is defaulting to the first option and hence pasting at the same relative coordinates to the origin as the Draft sheet.
you can move each DrawingObject separately.
I don't know the background of your application, I do it this way:
This involves some work but a great method to achieve what is required.
Sumit, I checked back my code and realized the constants were in fact created by me and not from Solid Edge.
Default coordinate pasting happens automatically but for a user-defined location for pasting, I gave the user the control by using the StartCommand for Paste.