I guess you recorded a macro and there are hundreds of lines with transforms? That's just you zooming in and out. You can remove most of that and still have a functioning macro.
I guess you need to do something like this:
- Create a SelectionManager
- Use GetSelectedObject6 (1, -1) to get the first selected item and put that into an object
- Check the type of the object to see if you can put it into a sketchPoint. I don't know if you can check the object type, otherwise create a Try Catch block that catches all errors (On Error GoTo labelName) and just try to put the object into a SketchPoint object.
- If that went well, get the position of the point. Make sure you know if the coordinates are local for that view or global for that sheet.
- Get the right drawing view
- Activate the drawing view for sketching
- Add a new point to the drawing view using CreatePoint
I can select the point already, and I didnt recorded a macro.
My problem is that, the selected point is a point in a sketch within the model.
and i want to create a point from the selected point.
In that case you could start by recording a macro Clean it up a little, add some things, post it here and tell us where you get stuck.
I wrote this macro a long time ago. It can almost certainly be simplified, but it will do the job.
Macro1.swp.zip 11.1 KB
Id tried it, but doesnt work.
In what way does it not work?
Did you step through the macro to see which line isn't working?